1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-28 12:25:06 +00:00

LibWeb: Turn a bunch of ASSERT_NOT_REACHED() in the parser into TODO()

This commit is contained in:
Andreas Kling 2020-05-30 10:35:25 +02:00
parent 6854f726ce
commit cfbd95f42a

View file

@ -216,7 +216,7 @@ RefPtr<Node> HTMLDocumentParser::find_appropriate_place_for_inserting_node()
{ {
auto& target = current_node(); auto& target = current_node();
if (m_foster_parenting) { if (m_foster_parenting) {
ASSERT_NOT_REACHED(); TODO();
} }
return target; return target;
} }
@ -370,12 +370,12 @@ void HTMLDocumentParser::handle_in_head(HTMLToken& token)
m_insertion_mode = InsertionMode::AfterHead; m_insertion_mode = InsertionMode::AfterHead;
return; return;
} }
ASSERT_NOT_REACHED(); TODO();
} }
void HTMLDocumentParser::handle_in_head_noscript(HTMLToken&) void HTMLDocumentParser::handle_in_head_noscript(HTMLToken&)
{ {
ASSERT_NOT_REACHED(); TODO();
} }
void HTMLDocumentParser::parse_generic_raw_text_element(HTMLToken& token) void HTMLDocumentParser::parse_generic_raw_text_element(HTMLToken& token)
@ -414,19 +414,19 @@ void HTMLDocumentParser::handle_after_head(HTMLToken& token)
return; return;
} }
ASSERT_NOT_REACHED(); TODO();
} }
if (token.is_comment()) { if (token.is_comment()) {
ASSERT_NOT_REACHED(); TODO();
} }
if (token.is_doctype()) { if (token.is_doctype()) {
ASSERT_NOT_REACHED(); TODO();
} }
if (token.is_start_tag() && token.tag_name() == "html") { if (token.is_start_tag() && token.tag_name() == "html") {
ASSERT_NOT_REACHED(); TODO();
} }
if (token.is_start_tag() && token.tag_name() == "body") { if (token.is_start_tag() && token.tag_name() == "body") {
@ -437,15 +437,15 @@ void HTMLDocumentParser::handle_after_head(HTMLToken& token)
} }
if (token.is_start_tag() && token.tag_name() == "frameset") { if (token.is_start_tag() && token.tag_name() == "frameset") {
ASSERT_NOT_REACHED(); TODO();
} }
if (token.is_start_tag() && token.tag_name().is_one_of("base", "basefont", "bgsound", "link", "meta", "noframes", "script", "style", "template", "title")) { if (token.is_start_tag() && token.tag_name().is_one_of("base", "basefont", "bgsound", "link", "meta", "noframes", "script", "style", "template", "title")) {
ASSERT_NOT_REACHED(); TODO();
} }
if (token.is_end_tag() && token.tag_name() == "template") { if (token.is_end_tag() && token.tag_name() == "template") {
ASSERT_NOT_REACHED(); TODO();
} }
if (token.is_end_tag() && token.tag_name().is_one_of("body", "html", "br")) { if (token.is_end_tag() && token.tag_name().is_one_of("body", "html", "br")) {
@ -453,7 +453,7 @@ void HTMLDocumentParser::handle_after_head(HTMLToken& token)
} }
if ((token.is_start_tag() && token.tag_name() == "head") || token.is_end_tag()) { if ((token.is_start_tag() && token.tag_name() == "head") || token.is_end_tag()) {
ASSERT_NOT_REACHED(); TODO();
} }
AnythingElse: AnythingElse:
@ -508,7 +508,7 @@ void HTMLDocumentParser::handle_after_body(HTMLToken& token)
if (token.is_end_tag() && token.tag_name() == "html") { if (token.is_end_tag() && token.tag_name() == "html") {
if (m_parsing_fragment) { if (m_parsing_fragment) {
ASSERT_NOT_REACHED(); TODO();
} }
m_insertion_mode = InsertionMode::AfterAfterBody; m_insertion_mode = InsertionMode::AfterAfterBody;
return; return;
@ -530,7 +530,7 @@ void HTMLDocumentParser::handle_after_after_body(HTMLToken& token)
stop_parsing(); stop_parsing();
return; return;
} }
ASSERT_NOT_REACHED(); TODO();
} }
void HTMLDocumentParser::reconstruct_the_active_formatting_elements() void HTMLDocumentParser::reconstruct_the_active_formatting_elements()
@ -730,7 +730,7 @@ void HTMLDocumentParser::handle_in_body(HTMLToken& token)
{ {
if (token.is_character()) { if (token.is_character()) {
if (token.codepoint() == 0) { if (token.codepoint() == 0) {
ASSERT_NOT_REACHED(); TODO();
} }
if (token.is_parser_whitespace()) { if (token.is_parser_whitespace()) {
reconstruct_the_active_formatting_elements(); reconstruct_the_active_formatting_elements();
@ -781,7 +781,7 @@ void HTMLDocumentParser::handle_in_body(HTMLToken& token)
if (token.is_end_tag() && token.tag_name() == "body") { if (token.is_end_tag() && token.tag_name() == "body") {
if (!m_stack_of_open_elements.has_in_scope("body")) { if (!m_stack_of_open_elements.has_in_scope("body")) {
ASSERT_NOT_REACHED(); TODO();
} }
// FIXME: Otherwise, if there is a node in the stack of open elements that is // FIXME: Otherwise, if there is a node in the stack of open elements that is
@ -1126,7 +1126,7 @@ void HTMLDocumentParser::handle_in_body(HTMLToken& token)
return; return;
} }
ASSERT_NOT_REACHED(); TODO();
} }
void HTMLDocumentParser::increment_script_nesting_level() void HTMLDocumentParser::increment_script_nesting_level()
@ -1211,7 +1211,7 @@ void HTMLDocumentParser::handle_text(HTMLToken& token)
m_insertion_mode = m_original_insertion_mode; m_insertion_mode = m_original_insertion_mode;
return; return;
} }
ASSERT_NOT_REACHED(); TODO();
} }
void HTMLDocumentParser::clear_the_stack_back_to_a_table_context() void HTMLDocumentParser::clear_the_stack_back_to_a_table_context()