mirror of
https://github.com/fergalmoran/ladybird.git
synced 2026-02-19 22:25:36 +00:00
LibWeb: Call children_changed() on text nodes when flushing characters
Now that we flush characters in a single place, we can call the Text's children_changed() from there instead of having a goofy targeted hack for <style> elements. :^)
This commit is contained in:
@@ -450,6 +450,7 @@ void HTMLDocumentParser::flush_character_insertions()
|
||||
if (m_character_insertion_builder.is_empty())
|
||||
return;
|
||||
m_character_insertion_node->set_data(m_character_insertion_builder.to_string());
|
||||
m_character_insertion_node->parent()->children_changed();
|
||||
m_character_insertion_builder.clear();
|
||||
}
|
||||
|
||||
@@ -1424,13 +1425,6 @@ void HTMLDocumentParser::handle_text(HTMLToken& token)
|
||||
return;
|
||||
}
|
||||
|
||||
// FIXME: This is a bit hackish, we can simplify this once we don't need to support
|
||||
// the old parser anymore, since then we don't need to maintain its children_changed() semantics.
|
||||
if (token.is_end_tag() && token.tag_name() == "style") {
|
||||
current_node().children_changed();
|
||||
// NOTE: We don't return here, keep going.
|
||||
}
|
||||
|
||||
if (token.is_end_tag()) {
|
||||
m_stack_of_open_elements.pop();
|
||||
m_insertion_mode = m_original_insertion_mode;
|
||||
|
||||
Reference in New Issue
Block a user