From 7196570f9bd038abd281341be26b0b7d02ff011b Mon Sep 17 00:00:00 2001 From: Sam Atkins Date: Thu, 2 Dec 2021 12:54:34 +0000 Subject: [PATCH] LibWeb: Cast unused smart-pointer return values to void --- Userland/Libraries/LibWeb/DOM/Element.cpp | 2 +- .../LibWeb/HTML/HTMLScriptElement.cpp | 2 +- .../LibWeb/HTML/Parser/HTMLParser.cpp | 198 +++++++++--------- .../HTML/Parser/StackOfOpenElements.cpp | 4 +- .../LibWeb/Layout/BlockFormattingContext.cpp | 4 +- .../LibWeb/Layout/FlexFormattingContext.cpp | 4 +- .../LibWeb/Layout/FormattingContext.cpp | 6 +- .../LibWeb/Layout/InlineFormattingContext.cpp | 2 +- .../LibWeb/Layout/TableFormattingContext.cpp | 8 +- .../LibWeb/WebAssembly/WebAssemblyObject.cpp | 2 +- 10 files changed, 116 insertions(+), 116 deletions(-) diff --git a/Userland/Libraries/LibWeb/DOM/Element.cpp b/Userland/Libraries/LibWeb/DOM/Element.cpp index af80164c7c..f421cde0f0 100644 --- a/Userland/Libraries/LibWeb/DOM/Element.cpp +++ b/Userland/Libraries/LibWeb/DOM/Element.cpp @@ -229,7 +229,7 @@ void Element::recompute_style() return; // We need a new layout tree here! Layout::TreeBuilder tree_builder; - tree_builder.build(*this); + (void)tree_builder.build(*this); return; } diff --git a/Userland/Libraries/LibWeb/HTML/HTMLScriptElement.cpp b/Userland/Libraries/LibWeb/HTML/HTMLScriptElement.cpp index 744d9467c4..01f7caa778 100644 --- a/Userland/Libraries/LibWeb/HTML/HTMLScriptElement.cpp +++ b/Userland/Libraries/LibWeb/HTML/HTMLScriptElement.cpp @@ -390,7 +390,7 @@ void HTMLScriptElement::prepare_script() // 3. Remove the first element from this list of scripts that will execute in order // as soon as possible. - m_preparation_time_document->scripts_to_execute_as_soon_as_possible().take_first(); + (void)m_preparation_time_document->scripts_to_execute_as_soon_as_possible().take_first(); // 4. If this list of scripts that will execute in order as soon as possible is still // not empty and the first entry has already been marked as ready, then jump back diff --git a/Userland/Libraries/LibWeb/HTML/Parser/HTMLParser.cpp b/Userland/Libraries/LibWeb/HTML/Parser/HTMLParser.cpp index 3919802f57..8797cb1588 100644 --- a/Userland/Libraries/LibWeb/HTML/Parser/HTMLParser.cpp +++ b/Userland/Libraries/LibWeb/HTML/Parser/HTMLParser.cpp @@ -203,7 +203,7 @@ void HTMLParser::the_end() // 4. Pop all the nodes off the stack of open elements. while (!m_stack_of_open_elements.is_empty()) - m_stack_of_open_elements.pop(); + (void)m_stack_of_open_elements.pop(); // 5. While the list of scripts that will execute when the document has finished parsing is not empty: while (!m_document->scripts_to_execute_when_parsing_has_finished().is_empty()) { @@ -218,7 +218,7 @@ void HTMLParser::the_end() m_document->scripts_to_execute_when_parsing_has_finished().first().execute_script(); // 3. Remove the first script element from the list of scripts that will execute when the document has finished parsing (i.e. shift out the first entry in the list). - m_document->scripts_to_execute_when_parsing_has_finished().take_first(); + (void)m_document->scripts_to_execute_when_parsing_has_finished().take_first(); } // 6. Queue a global task on the DOM manipulation task source given the Document's relevant global object to run the following substeps: @@ -663,21 +663,21 @@ void HTMLParser::handle_in_head(HTMLToken& token) } if (token.is_start_tag() && token.tag_name().is_one_of(HTML::TagNames::base, HTML::TagNames::basefont, HTML::TagNames::bgsound, HTML::TagNames::link)) { - insert_html_element(token); - m_stack_of_open_elements.pop(); + (void)insert_html_element(token); + (void)m_stack_of_open_elements.pop(); token.acknowledge_self_closing_flag_if_set(); return; } if (token.is_start_tag() && token.tag_name() == HTML::TagNames::meta) { auto element = insert_html_element(token); - m_stack_of_open_elements.pop(); + (void)m_stack_of_open_elements.pop(); token.acknowledge_self_closing_flag_if_set(); return; } if (token.is_start_tag() && token.tag_name() == HTML::TagNames::title) { - insert_html_element(token); + (void)insert_html_element(token); m_tokenizer.switch_to({}, HTMLTokenizer::State::RCDATA); m_original_insertion_mode = m_insertion_mode; m_insertion_mode = InsertionMode::Text; @@ -690,7 +690,7 @@ void HTMLParser::handle_in_head(HTMLToken& token) } if (token.is_start_tag() && token.tag_name() == HTML::TagNames::noscript && !m_scripting_enabled) { - insert_html_element(token); + (void)insert_html_element(token); m_insertion_mode = InsertionMode::InHeadNoscript; return; } @@ -718,7 +718,7 @@ void HTMLParser::handle_in_head(HTMLToken& token) return; } if (token.is_end_tag() && token.tag_name() == HTML::TagNames::head) { - m_stack_of_open_elements.pop(); + (void)m_stack_of_open_elements.pop(); m_insertion_mode = InsertionMode::AfterHead; return; } @@ -728,7 +728,7 @@ void HTMLParser::handle_in_head(HTMLToken& token) } if (token.is_start_tag() && token.tag_name() == HTML::TagNames::template_) { - insert_html_element(token); + (void)insert_html_element(token); m_list_of_active_formatting_elements.add_marker(); m_frameset_ok = false; m_insertion_mode = InsertionMode::InTemplate; @@ -760,7 +760,7 @@ void HTMLParser::handle_in_head(HTMLToken& token) } AnythingElse: - m_stack_of_open_elements.pop(); + (void)m_stack_of_open_elements.pop(); m_insertion_mode = InsertionMode::AfterHead; process_using_the_rules_for(m_insertion_mode, token); } @@ -778,7 +778,7 @@ void HTMLParser::handle_in_head_noscript(HTMLToken& token) } if (token.is_end_tag() && token.tag_name() == HTML::TagNames::noscript) { - m_stack_of_open_elements.pop(); + (void)m_stack_of_open_elements.pop(); m_insertion_mode = InsertionMode::InHead; return; } @@ -799,14 +799,14 @@ void HTMLParser::handle_in_head_noscript(HTMLToken& token) AnythingElse: log_parse_error(); - m_stack_of_open_elements.pop(); + (void)m_stack_of_open_elements.pop(); m_insertion_mode = InsertionMode::InHead; process_using_the_rules_for(m_insertion_mode, token); } void HTMLParser::parse_generic_raw_text_element(HTMLToken& token) { - insert_html_element(token); + (void)insert_html_element(token); m_tokenizer.switch_to({}, HTMLTokenizer::State::RAWTEXT); m_original_insertion_mode = m_insertion_mode; m_insertion_mode = InsertionMode::Text; @@ -876,14 +876,14 @@ void HTMLParser::handle_after_head(HTMLToken& token) } if (token.is_start_tag() && token.tag_name() == HTML::TagNames::body) { - insert_html_element(token); + (void)insert_html_element(token); m_frameset_ok = false; m_insertion_mode = InsertionMode::InBody; return; } if (token.is_start_tag() && token.tag_name() == HTML::TagNames::frameset) { - insert_html_element(token); + (void)insert_html_element(token); m_insertion_mode = InsertionMode::InFrameset; return; } @@ -913,7 +913,7 @@ void HTMLParser::handle_after_head(HTMLToken& token) } AnythingElse: - insert_html_element(HTMLToken::make_start_tag(HTML::TagNames::body)); + (void)insert_html_element(HTMLToken::make_start_tag(HTML::TagNames::body)); m_insertion_mode = InsertionMode::InBody; process_using_the_rules_for(m_insertion_mode, token); } @@ -921,13 +921,13 @@ AnythingElse: void HTMLParser::generate_implied_end_tags(const FlyString& exception) { while (current_node().local_name() != exception && current_node().local_name().is_one_of(HTML::TagNames::dd, HTML::TagNames::dt, HTML::TagNames::li, HTML::TagNames::optgroup, HTML::TagNames::option, HTML::TagNames::p, HTML::TagNames::rb, HTML::TagNames::rp, HTML::TagNames::rt, HTML::TagNames::rtc)) - m_stack_of_open_elements.pop(); + (void)m_stack_of_open_elements.pop(); } void HTMLParser::generate_all_implied_end_tags_thoroughly() { while (current_node().local_name().is_one_of(HTML::TagNames::caption, HTML::TagNames::colgroup, HTML::TagNames::dd, HTML::TagNames::dt, HTML::TagNames::li, HTML::TagNames::optgroup, HTML::TagNames::option, HTML::TagNames::p, HTML::TagNames::rb, HTML::TagNames::rp, HTML::TagNames::rt, HTML::TagNames::rtc, HTML::TagNames::tbody, HTML::TagNames::td, HTML::TagNames::tfoot, HTML::TagNames::th, HTML::TagNames::thead, HTML::TagNames::tr)) - m_stack_of_open_elements.pop(); + (void)m_stack_of_open_elements.pop(); } void HTMLParser::close_a_p_element() @@ -1056,7 +1056,7 @@ HTMLParser::AdoptionAgencyAlgorithmOutcome HTMLParser::run_the_adoption_agency_a // and the current node is not in the list of active formatting elements, // then pop the current node off the stack of open elements, and return. if (current_node().local_name() == subject && !m_list_of_active_formatting_elements.contains(current_node())) { - m_stack_of_open_elements.pop(); + (void)m_stack_of_open_elements.pop(); return AdoptionAgencyAlgorithmOutcome::DoNothing; } @@ -1083,8 +1083,8 @@ HTMLParser::AdoptionAgencyAlgorithmOutcome HTMLParser::run_the_adoption_agency_a if (!furthest_block) { while (¤t_node() != formatting_element) - m_stack_of_open_elements.pop(); - m_stack_of_open_elements.pop(); + (void)m_stack_of_open_elements.pop(); + (void)m_stack_of_open_elements.pop(); m_list_of_active_formatting_elements.remove(*formatting_element); return AdoptionAgencyAlgorithmOutcome::DoNothing; @@ -1330,7 +1330,7 @@ void HTMLParser::handle_in_body(HTMLToken& token) if (token.is_start_tag() && token.tag_name().is_one_of(HTML::TagNames::address, HTML::TagNames::article, HTML::TagNames::aside, HTML::TagNames::blockquote, HTML::TagNames::center, HTML::TagNames::details, HTML::TagNames::dialog, HTML::TagNames::dir, HTML::TagNames::div, HTML::TagNames::dl, HTML::TagNames::fieldset, HTML::TagNames::figcaption, HTML::TagNames::figure, HTML::TagNames::footer, HTML::TagNames::header, HTML::TagNames::hgroup, HTML::TagNames::main, HTML::TagNames::menu, HTML::TagNames::nav, HTML::TagNames::ol, HTML::TagNames::p, HTML::TagNames::section, HTML::TagNames::summary, HTML::TagNames::ul)) { if (m_stack_of_open_elements.has_in_button_scope(HTML::TagNames::p)) close_a_p_element(); - insert_html_element(token); + (void)insert_html_element(token); return; } @@ -1339,9 +1339,9 @@ void HTMLParser::handle_in_body(HTMLToken& token) close_a_p_element(); if (current_node().local_name().is_one_of(HTML::TagNames::h1, HTML::TagNames::h2, HTML::TagNames::h3, HTML::TagNames::h4, HTML::TagNames::h5, HTML::TagNames::h6)) { log_parse_error(); - m_stack_of_open_elements.pop(); + (void)m_stack_of_open_elements.pop(); } - insert_html_element(token); + (void)insert_html_element(token); return; } @@ -1349,7 +1349,7 @@ void HTMLParser::handle_in_body(HTMLToken& token) if (m_stack_of_open_elements.has_in_button_scope(HTML::TagNames::p)) close_a_p_element(); - insert_html_element(token); + (void)insert_html_element(token); m_frameset_ok = false; @@ -1400,7 +1400,7 @@ void HTMLParser::handle_in_body(HTMLToken& token) if (m_stack_of_open_elements.has_in_button_scope(HTML::TagNames::p)) close_a_p_element(); - insert_html_element(token); + (void)insert_html_element(token); return; } @@ -1429,14 +1429,14 @@ void HTMLParser::handle_in_body(HTMLToken& token) } if (m_stack_of_open_elements.has_in_button_scope(HTML::TagNames::p)) close_a_p_element(); - insert_html_element(token); + (void)insert_html_element(token); return; } if (token.is_start_tag() && token.tag_name() == HTML::TagNames::plaintext) { if (m_stack_of_open_elements.has_in_button_scope(HTML::TagNames::p)) close_a_p_element(); - insert_html_element(token); + (void)insert_html_element(token); m_tokenizer.switch_to({}, HTMLTokenizer::State::PLAINTEXT); return; } @@ -1448,7 +1448,7 @@ void HTMLParser::handle_in_body(HTMLToken& token) m_stack_of_open_elements.pop_until_an_element_with_tag_name_has_been_popped(HTML::TagNames::button); } reconstruct_the_active_formatting_elements(); - insert_html_element(token); + (void)insert_html_element(token); m_frameset_ok = false; return; } @@ -1499,7 +1499,7 @@ void HTMLParser::handle_in_body(HTMLToken& token) if (token.is_end_tag() && token.tag_name() == HTML::TagNames::p) { if (!m_stack_of_open_elements.has_in_button_scope(HTML::TagNames::p)) { log_parse_error(); - insert_html_element(HTMLToken::make_start_tag(HTML::TagNames::p)); + (void)insert_html_element(HTMLToken::make_start_tag(HTML::TagNames::p)); } close_a_p_element(); return; @@ -1599,7 +1599,7 @@ void HTMLParser::handle_in_body(HTMLToken& token) if (token.is_start_tag() && token.tag_name().is_one_of(HTML::TagNames::applet, HTML::TagNames::marquee, HTML::TagNames::object)) { reconstruct_the_active_formatting_elements(); - insert_html_element(token); + (void)insert_html_element(token); m_list_of_active_formatting_elements.add_marker(); m_frameset_ok = false; return; @@ -1625,7 +1625,7 @@ void HTMLParser::handle_in_body(HTMLToken& token) if (m_stack_of_open_elements.has_in_button_scope(HTML::TagNames::p)) close_a_p_element(); } - insert_html_element(token); + (void)insert_html_element(token); m_frameset_ok = false; m_insertion_mode = InsertionMode::InTable; return; @@ -1639,8 +1639,8 @@ void HTMLParser::handle_in_body(HTMLToken& token) if (token.is_start_tag() && token.tag_name().is_one_of(HTML::TagNames::area, HTML::TagNames::br, HTML::TagNames::embed, HTML::TagNames::img, HTML::TagNames::keygen, HTML::TagNames::wbr)) { BRStartTag: reconstruct_the_active_formatting_elements(); - insert_html_element(token); - m_stack_of_open_elements.pop(); + (void)insert_html_element(token); + (void)m_stack_of_open_elements.pop(); token.acknowledge_self_closing_flag_if_set(); m_frameset_ok = false; return; @@ -1648,8 +1648,8 @@ void HTMLParser::handle_in_body(HTMLToken& token) if (token.is_start_tag() && token.tag_name() == HTML::TagNames::input) { reconstruct_the_active_formatting_elements(); - insert_html_element(token); - m_stack_of_open_elements.pop(); + (void)insert_html_element(token); + (void)m_stack_of_open_elements.pop(); token.acknowledge_self_closing_flag_if_set(); auto type_attribute = token.attribute(HTML::AttributeNames::type); if (type_attribute.is_null() || !type_attribute.equals_ignoring_case("hidden")) { @@ -1659,8 +1659,8 @@ void HTMLParser::handle_in_body(HTMLToken& token) } if (token.is_start_tag() && token.tag_name().is_one_of(HTML::TagNames::param, HTML::TagNames::source, HTML::TagNames::track)) { - insert_html_element(token); - m_stack_of_open_elements.pop(); + (void)insert_html_element(token); + (void)m_stack_of_open_elements.pop(); token.acknowledge_self_closing_flag_if_set(); return; } @@ -1668,8 +1668,8 @@ void HTMLParser::handle_in_body(HTMLToken& token) if (token.is_start_tag() && token.tag_name() == HTML::TagNames::hr) { if (m_stack_of_open_elements.has_in_button_scope(HTML::TagNames::p)) close_a_p_element(); - insert_html_element(token); - m_stack_of_open_elements.pop(); + (void)insert_html_element(token); + (void)m_stack_of_open_elements.pop(); token.acknowledge_self_closing_flag_if_set(); m_frameset_ok = false; return; @@ -1684,7 +1684,7 @@ void HTMLParser::handle_in_body(HTMLToken& token) } if (token.is_start_tag() && token.tag_name() == HTML::TagNames::textarea) { - insert_html_element(token); + (void)insert_html_element(token); m_tokenizer.switch_to({}, HTMLTokenizer::State::RCDATA); @@ -1728,7 +1728,7 @@ void HTMLParser::handle_in_body(HTMLToken& token) if (token.is_start_tag() && token.tag_name() == HTML::TagNames::select) { reconstruct_the_active_formatting_elements(); - insert_html_element(token); + (void)insert_html_element(token); m_frameset_ok = false; switch (m_insertion_mode) { case InsertionMode::InTable: @@ -1747,9 +1747,9 @@ void HTMLParser::handle_in_body(HTMLToken& token) if (token.is_start_tag() && token.tag_name().is_one_of(HTML::TagNames::optgroup, HTML::TagNames::option)) { if (current_node().local_name() == HTML::TagNames::option) - m_stack_of_open_elements.pop(); + (void)m_stack_of_open_elements.pop(); reconstruct_the_active_formatting_elements(); - insert_html_element(token); + (void)insert_html_element(token); return; } @@ -1760,7 +1760,7 @@ void HTMLParser::handle_in_body(HTMLToken& token) if (current_node().local_name() != HTML::TagNames::ruby) log_parse_error(); - insert_html_element(token); + (void)insert_html_element(token); return; } @@ -1771,7 +1771,7 @@ void HTMLParser::handle_in_body(HTMLToken& token) if (current_node().local_name() != HTML::TagNames::rtc || current_node().local_name() != HTML::TagNames::ruby) log_parse_error(); - insert_html_element(token); + (void)insert_html_element(token); return; } @@ -1780,10 +1780,10 @@ void HTMLParser::handle_in_body(HTMLToken& token) adjust_mathml_attributes(token); adjust_foreign_attributes(token); - insert_foreign_element(token, Namespace::MathML); + (void)insert_foreign_element(token, Namespace::MathML); if (token.is_self_closing()) { - m_stack_of_open_elements.pop(); + (void)m_stack_of_open_elements.pop(); token.acknowledge_self_closing_flag_if_set(); } return; @@ -1794,10 +1794,10 @@ void HTMLParser::handle_in_body(HTMLToken& token) adjust_svg_attributes(token); adjust_foreign_attributes(token); - insert_foreign_element(token, Namespace::SVG); + (void)insert_foreign_element(token, Namespace::SVG); if (token.is_self_closing()) { - m_stack_of_open_elements.pop(); + (void)m_stack_of_open_elements.pop(); token.acknowledge_self_closing_flag_if_set(); } return; @@ -1811,7 +1811,7 @@ void HTMLParser::handle_in_body(HTMLToken& token) // Any other start tag if (token.is_start_tag()) { reconstruct_the_active_formatting_elements(); - insert_html_element(token); + (void)insert_html_element(token); return; } @@ -1826,9 +1826,9 @@ void HTMLParser::handle_in_body(HTMLToken& token) log_parse_error(); } while (¤t_node() != node) { - m_stack_of_open_elements.pop(); + (void)m_stack_of_open_elements.pop(); } - m_stack_of_open_elements.pop(); + (void)m_stack_of_open_elements.pop(); break; } if (is_special_tag(node->local_name(), node->namespace_())) { @@ -1983,7 +1983,7 @@ void HTMLParser::handle_text(HTMLToken& token) log_parse_error(); if (current_node().local_name() == HTML::TagNames::script) verify_cast(current_node()).set_already_started({}, true); - m_stack_of_open_elements.pop(); + (void)m_stack_of_open_elements.pop(); m_insertion_mode = m_original_insertion_mode; process_using_the_rules_for(m_insertion_mode, token); return; @@ -1993,7 +1993,7 @@ void HTMLParser::handle_text(HTMLToken& token) flush_character_insertions(); NonnullRefPtr script = verify_cast(current_node()); - m_stack_of_open_elements.pop(); + (void)m_stack_of_open_elements.pop(); m_insertion_mode = m_original_insertion_mode; // FIXME: Handle tokenizer insertion point stuff here. increment_script_nesting_level(); @@ -2053,7 +2053,7 @@ void HTMLParser::handle_text(HTMLToken& token) } if (token.is_end_tag()) { - m_stack_of_open_elements.pop(); + (void)m_stack_of_open_elements.pop(); m_insertion_mode = m_original_insertion_mode; return; } @@ -2063,7 +2063,7 @@ void HTMLParser::handle_text(HTMLToken& token) void HTMLParser::clear_the_stack_back_to_a_table_context() { while (!current_node().local_name().is_one_of(HTML::TagNames::table, HTML::TagNames::template_, HTML::TagNames::html)) - m_stack_of_open_elements.pop(); + (void)m_stack_of_open_elements.pop(); if (current_node().local_name() == HTML::TagNames::html) VERIFY(m_parsing_fragment); @@ -2072,7 +2072,7 @@ void HTMLParser::clear_the_stack_back_to_a_table_context() void HTMLParser::clear_the_stack_back_to_a_table_row_context() { while (!current_node().local_name().is_one_of(HTML::TagNames::tr, HTML::TagNames::template_, HTML::TagNames::html)) - m_stack_of_open_elements.pop(); + (void)m_stack_of_open_elements.pop(); if (current_node().local_name() == HTML::TagNames::html) VERIFY(m_parsing_fragment); @@ -2081,7 +2081,7 @@ void HTMLParser::clear_the_stack_back_to_a_table_row_context() void HTMLParser::clear_the_stack_back_to_a_table_body_context() { while (!current_node().local_name().is_one_of(HTML::TagNames::tbody, HTML::TagNames::tfoot, HTML::TagNames::thead, HTML::TagNames::template_, HTML::TagNames::html)) - m_stack_of_open_elements.pop(); + (void)m_stack_of_open_elements.pop(); if (current_node().local_name() == HTML::TagNames::html) VERIFY(m_parsing_fragment); @@ -2091,7 +2091,7 @@ void HTMLParser::handle_in_row(HTMLToken& token) { if (token.is_start_tag() && token.tag_name().is_one_of(HTML::TagNames::th, HTML::TagNames::td)) { clear_the_stack_back_to_a_table_row_context(); - insert_html_element(token); + (void)insert_html_element(token); m_insertion_mode = InsertionMode::InCell; m_list_of_active_formatting_elements.add_marker(); return; @@ -2103,7 +2103,7 @@ void HTMLParser::handle_in_row(HTMLToken& token) return; } clear_the_stack_back_to_a_table_row_context(); - m_stack_of_open_elements.pop(); + (void)m_stack_of_open_elements.pop(); m_insertion_mode = InsertionMode::InTableBody; return; } @@ -2115,7 +2115,7 @@ void HTMLParser::handle_in_row(HTMLToken& token) return; } clear_the_stack_back_to_a_table_row_context(); - m_stack_of_open_elements.pop(); + (void)m_stack_of_open_elements.pop(); m_insertion_mode = InsertionMode::InTableBody; process_using_the_rules_for(m_insertion_mode, token); return; @@ -2130,7 +2130,7 @@ void HTMLParser::handle_in_row(HTMLToken& token) return; } clear_the_stack_back_to_a_table_row_context(); - m_stack_of_open_elements.pop(); + (void)m_stack_of_open_elements.pop(); m_insertion_mode = InsertionMode::InTableBody; process_using_the_rules_for(m_insertion_mode, token); return; @@ -2151,8 +2151,8 @@ void HTMLParser::close_the_cell() log_parse_error(); } while (!current_node().local_name().is_one_of(HTML::TagNames::td, HTML::TagNames::th)) - m_stack_of_open_elements.pop(); - m_stack_of_open_elements.pop(); + (void)m_stack_of_open_elements.pop(); + (void)m_stack_of_open_elements.pop(); m_list_of_active_formatting_elements.clear_up_to_the_last_marker(); m_insertion_mode = InsertionMode::InRow; } @@ -2246,7 +2246,7 @@ void HTMLParser::handle_in_table_body(HTMLToken& token) { if (token.is_start_tag() && token.tag_name() == HTML::TagNames::tr) { clear_the_stack_back_to_a_table_body_context(); - insert_html_element(token); + (void)insert_html_element(token); m_insertion_mode = InsertionMode::InRow; return; } @@ -2254,7 +2254,7 @@ void HTMLParser::handle_in_table_body(HTMLToken& token) if (token.is_start_tag() && token.tag_name().is_one_of(HTML::TagNames::th, HTML::TagNames::td)) { log_parse_error(); clear_the_stack_back_to_a_table_body_context(); - insert_html_element(HTMLToken::make_start_tag(HTML::TagNames::tr)); + (void)insert_html_element(HTMLToken::make_start_tag(HTML::TagNames::tr)); m_insertion_mode = InsertionMode::InRow; process_using_the_rules_for(m_insertion_mode, token); return; @@ -2266,7 +2266,7 @@ void HTMLParser::handle_in_table_body(HTMLToken& token) return; } clear_the_stack_back_to_a_table_body_context(); - m_stack_of_open_elements.pop(); + (void)m_stack_of_open_elements.pop(); m_insertion_mode = InsertionMode::InTable; return; } @@ -2282,7 +2282,7 @@ void HTMLParser::handle_in_table_body(HTMLToken& token) } clear_the_stack_back_to_a_table_body_context(); - m_stack_of_open_elements.pop(); + (void)m_stack_of_open_elements.pop(); m_insertion_mode = InsertionMode::InTable; process_using_the_rules_for(InsertionMode::InTable, token); return; @@ -2316,32 +2316,32 @@ void HTMLParser::handle_in_table(HTMLToken& token) if (token.is_start_tag() && token.tag_name() == HTML::TagNames::caption) { clear_the_stack_back_to_a_table_context(); m_list_of_active_formatting_elements.add_marker(); - insert_html_element(token); + (void)insert_html_element(token); m_insertion_mode = InsertionMode::InCaption; return; } if (token.is_start_tag() && token.tag_name() == HTML::TagNames::colgroup) { clear_the_stack_back_to_a_table_context(); - insert_html_element(token); + (void)insert_html_element(token); m_insertion_mode = InsertionMode::InColumnGroup; return; } if (token.is_start_tag() && token.tag_name() == HTML::TagNames::col) { clear_the_stack_back_to_a_table_context(); - insert_html_element(HTMLToken::make_start_tag(HTML::TagNames::colgroup)); + (void)insert_html_element(HTMLToken::make_start_tag(HTML::TagNames::colgroup)); m_insertion_mode = InsertionMode::InColumnGroup; process_using_the_rules_for(m_insertion_mode, token); return; } if (token.is_start_tag() && token.tag_name().is_one_of(HTML::TagNames::tbody, HTML::TagNames::tfoot, HTML::TagNames::thead)) { clear_the_stack_back_to_a_table_context(); - insert_html_element(token); + (void)insert_html_element(token); m_insertion_mode = InsertionMode::InTableBody; return; } if (token.is_start_tag() && token.tag_name().is_one_of(HTML::TagNames::td, HTML::TagNames::th, HTML::TagNames::tr)) { clear_the_stack_back_to_a_table_context(); - insert_html_element(HTMLToken::make_start_tag(HTML::TagNames::tbody)); + (void)insert_html_element(HTMLToken::make_start_tag(HTML::TagNames::tbody)); m_insertion_mode = InsertionMode::InTableBody; process_using_the_rules_for(m_insertion_mode, token); return; @@ -2384,12 +2384,12 @@ void HTMLParser::handle_in_table(HTMLToken& token) } log_parse_error(); - insert_html_element(token); + (void)insert_html_element(token); // FIXME: Is this the correct interpretation of "Pop that input element off the stack of open elements."? // Because this wording is the first time it's seen in the spec. // Other times it's worded as: "Immediately pop the current node off the stack of open elements." - m_stack_of_open_elements.pop(); + (void)m_stack_of_open_elements.pop(); token.acknowledge_self_closing_flag_if_set(); return; } @@ -2402,7 +2402,7 @@ void HTMLParser::handle_in_table(HTMLToken& token) m_form_element = verify_cast(*insert_html_element(token)); // FIXME: See previous FIXME, as this is the same situation but for form. - m_stack_of_open_elements.pop(); + (void)m_stack_of_open_elements.pop(); return; } if (token.is_end_of_file()) { @@ -2470,29 +2470,29 @@ void HTMLParser::handle_in_select(HTMLToken& token) if (token.is_start_tag() && token.tag_name() == HTML::TagNames::option) { if (current_node().local_name() == HTML::TagNames::option) { - m_stack_of_open_elements.pop(); + (void)m_stack_of_open_elements.pop(); } - insert_html_element(token); + (void)insert_html_element(token); return; } if (token.is_start_tag() && token.tag_name() == HTML::TagNames::optgroup) { if (current_node().local_name() == HTML::TagNames::option) { - m_stack_of_open_elements.pop(); + (void)m_stack_of_open_elements.pop(); } if (current_node().local_name() == HTML::TagNames::optgroup) { - m_stack_of_open_elements.pop(); + (void)m_stack_of_open_elements.pop(); } - insert_html_element(token); + (void)insert_html_element(token); return; } if (token.is_end_tag() && token.tag_name() == HTML::TagNames::optgroup) { if (current_node().local_name() == HTML::TagNames::option && node_before_current_node().local_name() == HTML::TagNames::optgroup) - m_stack_of_open_elements.pop(); + (void)m_stack_of_open_elements.pop(); if (current_node().local_name() == HTML::TagNames::optgroup) { - m_stack_of_open_elements.pop(); + (void)m_stack_of_open_elements.pop(); } else { log_parse_error(); return; @@ -2502,7 +2502,7 @@ void HTMLParser::handle_in_select(HTMLToken& token) if (token.is_end_tag() && token.tag_name() == HTML::TagNames::option) { if (current_node().local_name() == HTML::TagNames::option) { - m_stack_of_open_elements.pop(); + (void)m_stack_of_open_elements.pop(); } else { log_parse_error(); return; @@ -2639,8 +2639,8 @@ void HTMLParser::handle_in_column_group(HTMLToken& token) } if (token.is_start_tag() && token.tag_name() == HTML::TagNames::col) { - insert_html_element(token); - m_stack_of_open_elements.pop(); + (void)insert_html_element(token); + (void)m_stack_of_open_elements.pop(); token.acknowledge_self_closing_flag_if_set(); return; } @@ -2651,7 +2651,7 @@ void HTMLParser::handle_in_column_group(HTMLToken& token) return; } - m_stack_of_open_elements.pop(); + (void)m_stack_of_open_elements.pop(); m_insertion_mode = InsertionMode::InTable; return; } @@ -2676,7 +2676,7 @@ void HTMLParser::handle_in_column_group(HTMLToken& token) return; } - m_stack_of_open_elements.pop(); + (void)m_stack_of_open_elements.pop(); m_insertion_mode = InsertionMode::InTable; process_using_the_rules_for(m_insertion_mode, token); } @@ -2782,14 +2782,14 @@ void HTMLParser::handle_in_frameset(HTMLToken& token) } if (token.is_start_tag() && token.tag_name() == HTML::TagNames::frameset) { - insert_html_element(token); + (void)insert_html_element(token); return; } if (token.is_end_tag() && token.tag_name() == HTML::TagNames::frameset) { // FIXME: If the current node is the root html element, then this is a parse error; ignore the token. (fragment case) - m_stack_of_open_elements.pop(); + (void)m_stack_of_open_elements.pop(); if (!m_parsing_fragment && current_node().local_name() != HTML::TagNames::frameset) { m_insertion_mode = InsertionMode::AfterFrameset; @@ -2798,8 +2798,8 @@ void HTMLParser::handle_in_frameset(HTMLToken& token) } if (token.is_start_tag() && token.tag_name() == HTML::TagNames::frame) { - insert_html_element(token); - m_stack_of_open_elements.pop(); + (void)insert_html_element(token); + (void)m_stack_of_open_elements.pop(); token.acknowledge_self_closing_flag_if_set(); return; } @@ -2921,7 +2921,7 @@ void HTMLParser::process_using_the_rules_for_foreign_content(HTMLToken& token) while (!is_mathml_text_integration_point(current_node()) && !is_html_integration_point(current_node()) && current_node().namespace_() != Namespace::HTML) { - m_stack_of_open_elements.pop(); + (void)m_stack_of_open_elements.pop(); } // Reprocess the token according to the rules given in the section corresponding to the current insertion mode in HTML content. @@ -2939,7 +2939,7 @@ void HTMLParser::process_using_the_rules_for_foreign_content(HTMLToken& token) } adjust_foreign_attributes(token); - insert_foreign_element(token, adjusted_current_node().namespace_()); + (void)insert_foreign_element(token, adjusted_current_node().namespace_()); if (token.is_self_closing()) { if (token.tag_name() == SVG::TagNames::script && current_node().namespace_() == Namespace::SVG) { @@ -2947,7 +2947,7 @@ void HTMLParser::process_using_the_rules_for_foreign_content(HTMLToken& token) goto ScriptEndTag; } - m_stack_of_open_elements.pop(); + (void)m_stack_of_open_elements.pop(); token.acknowledge_self_closing_flag_if_set(); } @@ -2956,7 +2956,7 @@ void HTMLParser::process_using_the_rules_for_foreign_content(HTMLToken& token) if (token.is_end_tag() && current_node().namespace_() == Namespace::SVG && current_node().tag_name() == SVG::TagNames::script) { ScriptEndTag: - m_stack_of_open_elements.pop(); + (void)m_stack_of_open_elements.pop(); TODO(); } @@ -2973,8 +2973,8 @@ void HTMLParser::process_using_the_rules_for_foreign_content(HTMLToken& token) // FIXME: See the above FIXME if (node->tag_name().to_lowercase() == token.tag_name()) { while (current_node() != node) - m_stack_of_open_elements.pop(); - m_stack_of_open_elements.pop(); + (void)m_stack_of_open_elements.pop(); + (void)m_stack_of_open_elements.pop(); return; } diff --git a/Userland/Libraries/LibWeb/HTML/Parser/StackOfOpenElements.cpp b/Userland/Libraries/LibWeb/HTML/Parser/StackOfOpenElements.cpp index c564b50928..1b833e9a74 100644 --- a/Userland/Libraries/LibWeb/HTML/Parser/StackOfOpenElements.cpp +++ b/Userland/Libraries/LibWeb/HTML/Parser/StackOfOpenElements.cpp @@ -96,8 +96,8 @@ bool StackOfOpenElements::contains(const FlyString& tag_name) const void StackOfOpenElements::pop_until_an_element_with_tag_name_has_been_popped(const FlyString& tag_name) { while (m_elements.last().local_name() != tag_name) - pop(); - pop(); + (void)pop(); + (void)pop(); } DOM::Element* StackOfOpenElements::topmost_special_node_below(const DOM::Element& formatting_element) diff --git a/Userland/Libraries/LibWeb/Layout/BlockFormattingContext.cpp b/Userland/Libraries/LibWeb/Layout/BlockFormattingContext.cpp index 3f64543913..cc61e159e2 100644 --- a/Userland/Libraries/LibWeb/Layout/BlockFormattingContext.cpp +++ b/Userland/Libraries/LibWeb/Layout/BlockFormattingContext.cpp @@ -398,7 +398,7 @@ void BlockFormattingContext::layout_block_level_children(BlockContainer& block_c } compute_width(child_box); - layout_inside(child_box, layout_mode); + (void)layout_inside(child_box, layout_mode); compute_height(child_box); if (child_box.computed_values().position() == CSS::Position::Relative) @@ -576,7 +576,7 @@ void BlockFormattingContext::layout_floating_child(Box& box, BlockContainer cons VERIFY(box.is_floating()); compute_width(box); - layout_inside(box, LayoutMode::Default); + (void)layout_inside(box, LayoutMode::Default); compute_height(box); // First we place the box normally (to get the right y coordinate.) diff --git a/Userland/Libraries/LibWeb/Layout/FlexFormattingContext.cpp b/Userland/Libraries/LibWeb/Layout/FlexFormattingContext.cpp index c66ecb49d1..8e7a573fed 100644 --- a/Userland/Libraries/LibWeb/Layout/FlexFormattingContext.cpp +++ b/Userland/Libraries/LibWeb/Layout/FlexFormattingContext.cpp @@ -143,7 +143,7 @@ void FlexFormattingContext::generate_anonymous_flex_items() } flex_container().for_each_child_of_type([&](Box& child_box) { - layout_inside(child_box, LayoutMode::Default); + (void)layout_inside(child_box, LayoutMode::Default); // Skip anonymous text runs that are only whitespace. if (child_box.is_anonymous() && !child_box.first_child_of_type()) { bool contains_only_white_space = true; @@ -444,7 +444,7 @@ float FlexFormattingContext::layout_for_maximum_main_size(Box& box) } } if (is_row_layout()) { - layout_inside(box, LayoutMode::OnlyRequiredLineBreaks); + (void)layout_inside(box, LayoutMode::OnlyRequiredLineBreaks); return box.width(); } else { return BlockFormattingContext::compute_theoretical_height(box); diff --git a/Userland/Libraries/LibWeb/Layout/FormattingContext.cpp b/Userland/Libraries/LibWeb/Layout/FormattingContext.cpp index 871d85abbc..6edbbd46d7 100644 --- a/Userland/Libraries/LibWeb/Layout/FormattingContext.cpp +++ b/Userland/Libraries/LibWeb/Layout/FormattingContext.cpp @@ -137,13 +137,13 @@ FormattingContext::ShrinkToFitResult FormattingContext::calculate_shrink_to_fit_ { // Calculate the preferred width by formatting the content without breaking lines // other than where explicit line breaks occur. - layout_inside(box, LayoutMode::OnlyRequiredLineBreaks); + (void)layout_inside(box, LayoutMode::OnlyRequiredLineBreaks); float preferred_width = greatest_child_width(box); // Also calculate the preferred minimum width, e.g., by trying all possible line breaks. // CSS 2.2 does not define the exact algorithm. - layout_inside(box, LayoutMode::AllPossibleLineBreaks); + (void)layout_inside(box, LayoutMode::AllPossibleLineBreaks); float preferred_minimum_width = greatest_child_width(box); return { preferred_width, preferred_minimum_width }; @@ -603,7 +603,7 @@ void FormattingContext::layout_absolutely_positioned_element(Box& box) auto specified_width = box.computed_values().width().resolved_or_auto(box, containing_block.width()); compute_width_for_absolutely_positioned_element(box); - layout_inside(box, LayoutMode::Default); + (void)layout_inside(box, LayoutMode::Default); compute_height_for_absolutely_positioned_element(box); box_model.margin.left = box.computed_values().margin().left.resolved_or_auto(box, containing_block.width()).to_px(box); diff --git a/Userland/Libraries/LibWeb/Layout/InlineFormattingContext.cpp b/Userland/Libraries/LibWeb/Layout/InlineFormattingContext.cpp index 06f50ba25f..8bdad68c7c 100644 --- a/Userland/Libraries/LibWeb/Layout/InlineFormattingContext.cpp +++ b/Userland/Libraries/LibWeb/Layout/InlineFormattingContext.cpp @@ -215,7 +215,7 @@ void InlineFormattingContext::dimension_box_on_line(Box& box, LayoutMode layout_ } else { inline_block.set_width(inline_block.computed_values().width().resolved_or_zero(inline_block, containing_block().width()).to_px(inline_block)); } - layout_inside(inline_block, layout_mode); + (void)layout_inside(inline_block, layout_mode); if (inline_block.computed_values().height().is_undefined_or_auto()) { // FIXME: (10.6.6) If 'height' is 'auto', the height depends on the element's descendants per 10.6.7. diff --git a/Userland/Libraries/LibWeb/Layout/TableFormattingContext.cpp b/Userland/Libraries/LibWeb/Layout/TableFormattingContext.cpp index d3719304ac..bd87bdf925 100644 --- a/Userland/Libraries/LibWeb/Layout/TableFormattingContext.cpp +++ b/Userland/Libraries/LibWeb/Layout/TableFormattingContext.cpp @@ -76,9 +76,9 @@ void TableFormattingContext::calculate_column_widths(Box& row, Vector& co row.for_each_child_of_type([&](auto& cell) { compute_width(cell); if (use_auto_layout) { - layout_inside(cell, LayoutMode::OnlyRequiredLineBreaks); + (void)layout_inside(cell, LayoutMode::OnlyRequiredLineBreaks); } else { - layout_inside(cell, LayoutMode::Default); + (void)layout_inside(cell, LayoutMode::Default); } column_widths[column_index] = max(column_widths[column_index], cell.width()); column_index += cell.colspan(); @@ -98,9 +98,9 @@ void TableFormattingContext::layout_row(Box& row, Vector& column_widths) // Layout the cell contents a second time, now that we know its final width. if (use_auto_layout) { - layout_inside(cell, LayoutMode::OnlyRequiredLineBreaks); + (void)layout_inside(cell, LayoutMode::OnlyRequiredLineBreaks); } else { - layout_inside(cell, LayoutMode::Default); + (void)layout_inside(cell, LayoutMode::Default); } size_t cell_colspan = cell.colspan(); diff --git a/Userland/Libraries/LibWeb/WebAssembly/WebAssemblyObject.cpp b/Userland/Libraries/LibWeb/WebAssembly/WebAssemblyObject.cpp index 76d6b3cf7b..34e33a0a4a 100644 --- a/Userland/Libraries/LibWeb/WebAssembly/WebAssemblyObject.cpp +++ b/Userland/Libraries/LibWeb/WebAssembly/WebAssemblyObject.cpp @@ -104,7 +104,7 @@ JS_DEFINE_NATIVE_FUNCTION(WebAssemblyObject::validate) // Drop the module from the cache, we're never going to refer to it. ScopeGuard drop_from_cache { [&] { - s_compiled_modules.take_last(); + (void)s_compiled_modules.take_last(); } };