From 3ce1af27dcee1891056756582221263f91bfe357 Mon Sep 17 00:00:00 2001 From: Andreas Kling Date: Thu, 28 May 2020 00:21:31 +0200 Subject: [PATCH] LibWeb: Parse documents without DOCTYPE gracefully Seems like SOMEONE forgot to put a on serenityos.org.. No matter, now we can handle it in the new parser! :^) --- Libraries/LibWeb/Parser/HTMLDocumentParser.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/Libraries/LibWeb/Parser/HTMLDocumentParser.cpp b/Libraries/LibWeb/Parser/HTMLDocumentParser.cpp index a4dfd4026d..b7968dd5c3 100644 --- a/Libraries/LibWeb/Parser/HTMLDocumentParser.cpp +++ b/Libraries/LibWeb/Parser/HTMLDocumentParser.cpp @@ -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)