mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-04-21 20:15:17 +00:00
LibWeb: Fully implement end tag parsing in foreign content
Required to view the Spotify home page
This commit is contained in:
parent
306aff80d0
commit
0bf44ac9d8
Notes:
sideshowbarker
2024-07-19 00:11:23 +09:00
Author: https://github.com/Lubrsi Commit: https://github.com/SerenityOS/serenity/commit/0bf44ac9d87 Pull-request: https://github.com/SerenityOS/serenity/pull/4757
1 changed files with 14 additions and 7 deletions
|
@ -2846,23 +2846,30 @@ void HTMLDocumentParser::process_using_the_rules_for_foreign_content(HTMLToken&
|
|||
}
|
||||
|
||||
if (token.is_end_tag()) {
|
||||
auto& node = current_node();
|
||||
RefPtr<DOM::Element> node = current_node();
|
||||
// FIXME: Not sure if this is the correct to_lowercase, as the specification says "to ASCII lowercase"
|
||||
if (node.tag_name().to_lowercase() != token.tag_name())
|
||||
if (node->tag_name().to_lowercase() != token.tag_name())
|
||||
PARSE_ERROR();
|
||||
while (true) {
|
||||
if (&node == &m_stack_of_open_elements.first()) {
|
||||
for (ssize_t i = m_stack_of_open_elements.elements().size() - 1; i >= 0; --i) {
|
||||
if (node == m_stack_of_open_elements.first()) {
|
||||
ASSERT(m_parsing_fragment);
|
||||
return;
|
||||
}
|
||||
// FIXME: See the above FIXME
|
||||
if (node.tag_name().to_lowercase() == token.tag_name()) {
|
||||
while (¤t_node() != &node)
|
||||
if (node->tag_name().to_lowercase() == token.tag_name()) {
|
||||
while (current_node() != node)
|
||||
m_stack_of_open_elements.pop();
|
||||
m_stack_of_open_elements.pop();
|
||||
return;
|
||||
}
|
||||
TODO();
|
||||
|
||||
node = m_stack_of_open_elements.elements().at(i - 1);
|
||||
|
||||
if (node->namespace_() != Namespace::HTML)
|
||||
continue;
|
||||
|
||||
process_using_the_rules_for(m_insertion_mode, token);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue