mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-06-24 11:11:51 +00:00
LibWeb: Fix early return condition in Node::invalidate_style()
When checking whether an early return is possible because some ancestor already has the whole subtree invalidation flag set, the check should begin with the current node's parent rather than with the node itself. Otherwise, if a node already has the whole subtree invalidation flag set and is subsequently invalidated for the reason `NodeInsertBefore` or `NodeRemove`, we will skip the sibling invalidation required for these operations This fix is required for optimizations in subsequent commits.
This commit is contained in:
parent
61c952fb43
commit
daf7c1ef60
Notes:
github-actions[bot]
2025-02-06 19:08:30 +00:00
Author: https://github.com/kalenikaliaksandr
Commit: daf7c1ef60
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/3476
Reviewed-by: https://github.com/AtkinsSJ
1 changed files with 1 additions and 1 deletions
|
@ -423,7 +423,7 @@ void Node::invalidate_style(StyleInvalidationReason reason)
|
|||
}
|
||||
|
||||
// If any ancestor is already marked for an entire subtree update, there's no need to do anything here.
|
||||
for (auto* ancestor = this; ancestor; ancestor = ancestor->parent_or_shadow_host()) {
|
||||
for (auto* ancestor = this->parent_or_shadow_host(); ancestor; ancestor = ancestor->parent_or_shadow_host()) {
|
||||
if (ancestor->entire_subtree_needs_style_update())
|
||||
return;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue