mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-11-10 13:00:29 +03:00
LibWeb: Fix mistake in Node::invalidate_style()
We were not actually walking past the first ancestor when setting child-needs-update bit upwards. Also, let's walk all the way to the root, even if there's a child-needs-update bit already set. This ensures that we always leave this function with the ancestor chain in a sane state.
This commit is contained in:
parent
b4bda4cdf3
commit
1881761d0f
Notes:
sideshowbarker
2024-07-17 17:20:57 +09:00
Author: https://github.com/awesomekling Commit: https://github.com/SerenityOS/serenity/commit/1881761d0f
@ -188,11 +188,8 @@ void Node::invalidate_style()
|
||||
}
|
||||
return IterationDecision::Continue;
|
||||
});
|
||||
for (auto* ancestor = parent_or_shadow_host(); ancestor; ancestor = parent_or_shadow_host()) {
|
||||
if (ancestor->m_child_needs_style_update)
|
||||
break;
|
||||
for (auto* ancestor = parent_or_shadow_host(); ancestor; ancestor = ancestor->parent_or_shadow_host())
|
||||
ancestor->m_child_needs_style_update = true;
|
||||
}
|
||||
document().schedule_style_update();
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user