LibWeb: Don't invalidate style for animations in idle state

This commit is contained in:
Aliaksandr Kalenik 2025-03-04 16:17:49 +01:00 committed by Alexander Kalenik
parent b92a8553c7
commit 80c0a16597
Notes: github-actions[bot] 2025-03-04 17:37:09 +00:00
2 changed files with 3 additions and 1 deletions

View file

@ -66,6 +66,8 @@ public:
GC::Ref<WebIDL::Promise> finished() const { return current_finished_promise(); }
bool is_finished() const { return m_is_finished; }
bool is_idle() const { return play_state() == Bindings::AnimationPlayState::Idle; }
GC::Ptr<WebIDL::CallbackType> onfinish();
void set_onfinish(GC::Ptr<WebIDL::CallbackType>);
GC::Ptr<WebIDL::CallbackType> oncancel();

View file

@ -1522,7 +1522,7 @@ void Document::update_animated_style_if_needed()
for (auto& timeline : m_associated_animation_timelines) {
for (auto& animation : timeline->associated_animations()) {
if (animation->is_finished())
if (animation->is_idle() || animation->is_finished())
continue;
if (auto effect = animation->effect()) {
if (auto* target = effect->target())