mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-08-09 09:39:39 +00:00
LibWeb: Reset and update animated style in a single pass
...and skip resetting animated style of finished animations.
This commit is contained in:
parent
8e481f65f5
commit
1ce1a8f8f1
Notes:
github-actions[bot]
2025-03-03 20:46:28 +00:00
Author: https://github.com/kalenikaliaksandr
Commit: 1ce1a8f8f1
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/3783
Reviewed-by: https://github.com/awesomekling ✅
1 changed files with 4 additions and 6 deletions
|
@ -1523,18 +1523,16 @@ void Document::update_animated_style_if_needed()
|
||||||
invalidate_display_list();
|
invalidate_display_list();
|
||||||
|
|
||||||
for (auto& timeline : m_associated_animation_timelines) {
|
for (auto& timeline : m_associated_animation_timelines) {
|
||||||
for (auto& animation : timeline->associated_animations()) {
|
|
||||||
if (auto effect = animation->effect(); effect && effect->target())
|
|
||||||
effect->target()->reset_animated_css_properties();
|
|
||||||
}
|
|
||||||
|
|
||||||
for (auto& animation : timeline->associated_animations()) {
|
for (auto& animation : timeline->associated_animations()) {
|
||||||
if (animation->is_finished())
|
if (animation->is_finished())
|
||||||
continue;
|
continue;
|
||||||
if (auto effect = animation->effect())
|
if (auto effect = animation->effect()) {
|
||||||
|
if (auto* target = effect->target())
|
||||||
|
target->reset_animated_css_properties();
|
||||||
effect->update_computed_properties();
|
effect->update_computed_properties();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
m_needs_animated_style_update = false;
|
m_needs_animated_style_update = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue