LibWeb: Early return when invalidations=none in animation style update

This allows to skip a bunch of unnecessary work performed by
`apply_style()`.
This commit is contained in:
Aliaksandr Kalenik 2025-02-17 19:29:01 +01:00 committed by Andreas Kling
commit 9dd59e0673
Notes: github-actions[bot] 2025-02-17 23:25:43 +00:00

View file

@ -938,6 +938,9 @@ void KeyframeEffect::update_computed_properties()
auto invalidation = compute_required_invalidation(animated_properties_before_update, style->animated_property_values());
if (invalidation.is_none())
return;
// 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) {
auto element_invalidation = element.recompute_inherited_style();