summaryrefslogtreecommitdiff
path: root/Libraries/LibWeb
diff options
context:
space:
mode:
authorKyle McLean <kylem590@gmail.com>2020-06-03 23:28:57 -0600
committerAndreas Kling <kling@serenityos.org>2020-06-04 09:09:33 +0200
commitb9549078ccf35b1d4a24bc0884d2ffc109ccedf6 (patch)
treefe3d2425d8e99f28ef61415159201fbe6ec01fcc /Libraries/LibWeb
parenta3bf3a5d681e811bd6531e664a10b0425e7b437a (diff)
downloadserenity-b9549078ccf35b1d4a24bc0884d2ffc109ccedf6.zip
LibWeb: Handle "html" end tag during "in body"
Diffstat (limited to 'Libraries/LibWeb')
-rw-r--r--Libraries/LibWeb/Parser/HTMLDocumentParser.cpp18
1 files changed, 18 insertions, 0 deletions
diff --git a/Libraries/LibWeb/Parser/HTMLDocumentParser.cpp b/Libraries/LibWeb/Parser/HTMLDocumentParser.cpp
index aeb181877e..629a5c6f42 100644
--- a/Libraries/LibWeb/Parser/HTMLDocumentParser.cpp
+++ b/Libraries/LibWeb/Parser/HTMLDocumentParser.cpp
@@ -905,6 +905,24 @@ void HTMLDocumentParser::handle_in_body(HTMLToken& token)
return;
}
+ if (token.is_end_tag() && token.tag_name() == "html") {
+ if (!m_stack_of_open_elements.has_in_scope("body")) {
+ PARSE_ERROR();
+ return;
+ }
+
+ for (auto& node : m_stack_of_open_elements.elements()) {
+ if (!node.tag_name().is_one_of("dd", "dt", "li", "optgroup", "option", "p", "rb", "rp", "rt", "rtc", "tbody", "td", "tfoot", "th", "thead", "tr", "body", "html")) {
+ PARSE_ERROR();
+ break;
+ }
+ }
+
+ m_insertion_mode = InsertionMode::AfterBody;
+ process_using_the_rules_for(m_insertion_mode, token);
+ return;
+ }
+
if (token.is_start_tag() && token.tag_name().is_one_of("address", "article", "aside", "blockquote", "center", "details", "dialog", "dir", "div", "dl", "fieldset", "figcaption", "figure", "footer", "header", "hgroup", "main", "menu", "nav", "ol", "p", "section", "summary", "ul")) {
if (m_stack_of_open_elements.has_in_button_scope("p"))
close_a_p_element();