mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 05:07:34 +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:
parent
21957745f7
commit
3c2fbc825c
1 changed files with 1 additions and 7 deletions
|
@ -450,6 +450,7 @@ void HTMLDocumentParser::flush_character_insertions()
|
||||||
if (m_character_insertion_builder.is_empty())
|
if (m_character_insertion_builder.is_empty())
|
||||||
return;
|
return;
|
||||||
m_character_insertion_node->set_data(m_character_insertion_builder.to_string());
|
m_character_insertion_node->set_data(m_character_insertion_builder.to_string());
|
||||||
|
m_character_insertion_node->parent()->children_changed();
|
||||||
m_character_insertion_builder.clear();
|
m_character_insertion_builder.clear();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1424,13 +1425,6 @@ void HTMLDocumentParser::handle_text(HTMLToken& token)
|
||||||
return;
|
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()) {
|
if (token.is_end_tag()) {
|
||||||
m_stack_of_open_elements.pop();
|
m_stack_of_open_elements.pop();
|
||||||
m_insertion_mode = m_original_insertion_mode;
|
m_insertion_mode = m_original_insertion_mode;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue