mirror of
https://github.com/SerenityOS/serenity.git
synced 2025-01-23 18:02:05 -05:00
LibWeb: Stop traversal early when marking nodes for child style update
These flags always propagate to the root, so once we encounter an ancestor with the flag set, we can stop traversal since everything above it will already be set as well. (cherry picked from commit f106aa9e8a8f3a98b498e0f9324123963fad6ca2)
This commit is contained in:
parent
72227066c6
commit
880b6b1375
1 changed files with 2 additions and 0 deletions
|
@ -1174,6 +1174,8 @@ void Node::set_needs_style_update(bool value)
|
|||
|
||||
if (m_needs_style_update) {
|
||||
for (auto* ancestor = parent_or_shadow_host(); ancestor; ancestor = ancestor->parent_or_shadow_host()) {
|
||||
if (ancestor->m_child_needs_style_update)
|
||||
break;
|
||||
ancestor->m_child_needs_style_update = true;
|
||||
}
|
||||
document().schedule_style_update();
|
||||
|
|
Loading…
Add table
Reference in a new issue