mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-08-01 13:49:16 +00:00
LibWeb: Optimize inherited style update caused by animation
It is possible to skip inherited style recalculation for children if parent's recalculation does not cause any changes. Improves performance on Github where we could avoid dozens of inherited style calculations that do not produce any visible changes.
This commit is contained in:
parent
482e5deb85
commit
8fdfadb0c9
Notes:
github-actions[bot]
2025-01-05 10:31:56 +00:00
Author: https://github.com/kalenikaliaksandr
Commit: 8fdfadb0c9
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/3143
1 changed files with 4 additions and 1 deletions
|
@ -939,7 +939,10 @@ void KeyframeEffect::update_computed_properties()
|
|||
|
||||
// Traversal of the subtree is necessary to update the animated properties inherited from the target element.
|
||||
target->for_each_in_subtree_of_type<DOM::Element>([&](auto& element) {
|
||||
invalidation |= element.recompute_inherited_style();
|
||||
auto element_invalidation = element.recompute_inherited_style();
|
||||
if (element_invalidation.is_none())
|
||||
return TraversalDecision::SkipChildrenAndContinue;
|
||||
invalidation |= element_invalidation;
|
||||
return TraversalDecision::Continue;
|
||||
});
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue