summaryrefslogtreecommitdiff
path: root/Libraries
diff options
context:
space:
mode:
authorAndreas Kling <kling@serenityos.org>2020-05-28 18:52:32 +0200
committerAndreas Kling <kling@serenityos.org>2020-05-28 18:52:32 +0200
commit00b44ab1489332d33e60979d7688145f097bd6e6 (patch)
tree0292395a247b92eba45e26e1aee7aba617c6c2c7 /Libraries
parentcba5d59adcee5d08446fc1e666b73015b846dc78 (diff)
downloadserenity-00b44ab1489332d33e60979d7688145f097bd6e6.zip
LibWeb: Implement more of the "after body" insertion mode
Diffstat (limited to 'Libraries')
-rw-r--r--Libraries/LibWeb/Parser/HTMLDocumentParser.cpp24
1 files changed, 23 insertions, 1 deletions
diff --git a/Libraries/LibWeb/Parser/HTMLDocumentParser.cpp b/Libraries/LibWeb/Parser/HTMLDocumentParser.cpp
index 8c37753d67..9a85af72a4 100644
--- a/Libraries/LibWeb/Parser/HTMLDocumentParser.cpp
+++ b/Libraries/LibWeb/Parser/HTMLDocumentParser.cpp
@@ -482,6 +482,25 @@ void HTMLDocumentParser::handle_after_body(HTMLToken& token)
return;
}
+ if (token.is_comment()) {
+ TODO();
+ }
+
+ if (token.is_doctype()) {
+ PARSE_ERROR();
+ return;
+ }
+
+ if (token.is_start_tag() && token.tag_name() == "html") {
+ process_using_the_rules_for(InsertionMode::InBody, token);
+ return;
+ }
+
+ if (token.is_end_of_file()) {
+ // FIXME: Stop parsing!
+ TODO();
+ }
+
if (token.is_end_tag() && token.tag_name() == "html") {
if (m_parsing_fragment) {
ASSERT_NOT_REACHED();
@@ -489,7 +508,10 @@ void HTMLDocumentParser::handle_after_body(HTMLToken& token)
m_insertion_mode = InsertionMode::AfterAfterBody;
return;
}
- ASSERT_NOT_REACHED();
+
+ PARSE_ERROR();
+ m_insertion_mode = InsertionMode::InBody;
+ process_using_the_rules_for(InsertionMode::InBody, token);
}
void HTMLDocumentParser::handle_after_after_body(HTMLToken& token)