mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-04-22 04:25:13 +00:00
LibWeb: Handle "html" end tag during "in body"
This commit is contained in:
parent
a3bf3a5d68
commit
b9549078cc
Notes:
sideshowbarker
2024-07-19 05:50:55 +09:00
Author: https://github.com/kylemclean Commit: https://github.com/SerenityOS/serenity/commit/b9549078ccf Pull-request: https://github.com/SerenityOS/serenity/pull/2491
1 changed files with 18 additions and 0 deletions
|
@ -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();
|
||||
|
|
Loading…
Add table
Reference in a new issue