LibWeb: Parse documents without DOCTYPE gracefully

Seems like SOMEONE forgot to put a <!DOCTYPE html> on serenityos.org..
No matter, now we can handle it in the new parser! :^)
This commit is contained in:
Andreas Kling 2020-05-28 00:21:31 +02:00
parent 422e00c806
commit 3ce1af27dc
Notes: sideshowbarker 2024-07-19 06:03:38 +09:00

View file

@ -142,7 +142,11 @@ void HTMLDocumentParser::handle_initial(HTMLToken& token)
m_insertion_mode = InsertionMode::BeforeHTML;
return;
}
ASSERT_NOT_REACHED();
PARSE_ERROR();
document().set_quirks_mode(true);
m_insertion_mode = InsertionMode::BeforeHTML;
process_using_the_rules_for(InsertionMode::BeforeHTML, token);
}
void HTMLDocumentParser::handle_before_html(HTMLToken& token)