mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-04-21 03:55:24 +00:00
LibWeb: Parse "body" end tags during "in body"
This commit is contained in:
parent
1ad81e4833
commit
5e3972a946
Notes:
sideshowbarker
2024-07-19 05:51:12 +09:00
Author: https://github.com/kylemclean Commit: https://github.com/SerenityOS/serenity/commit/5e3972a9463 Pull-request: https://github.com/SerenityOS/serenity/pull/2491
1 changed files with 8 additions and 7 deletions
|
@ -889,15 +889,16 @@ void HTMLDocumentParser::handle_in_body(HTMLToken& token)
|
|||
|
||||
if (token.is_end_tag() && token.tag_name() == "body") {
|
||||
if (!m_stack_of_open_elements.has_in_scope("body")) {
|
||||
TODO();
|
||||
PARSE_ERROR();
|
||||
return;
|
||||
}
|
||||
|
||||
// FIXME: Otherwise, if there is a node in the stack of open elements that is
|
||||
// not either a dd element, a dt element, an li element, an optgroup element,
|
||||
// an option element, a p element, an rb element, an rp element, an rt element,
|
||||
// an rtc element, a tbody element, a td element, a tfoot element, a th element,
|
||||
// a thead element, a tr element, the body element, or the html element,
|
||||
// then this is a parse error.
|
||||
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;
|
||||
return;
|
||||
|
|
Loading…
Add table
Reference in a new issue