From 42d5883d57312a41084c625e06335a26a9498aff Mon Sep 17 00:00:00 2001 From: Aliaksandr Kalenik Date: Thu, 21 Mar 2024 14:49:30 +0100 Subject: [PATCH] LibWeb: Set animation update flag from Animation::invalidate_effect() Fixes regressed animation tests. --- Userland/Libraries/LibWeb/Animations/Animation.cpp | 4 +++- Userland/Libraries/LibWeb/DOM/Document.cpp | 2 -- Userland/Libraries/LibWeb/DOM/Document.h | 1 + 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/Userland/Libraries/LibWeb/Animations/Animation.cpp b/Userland/Libraries/LibWeb/Animations/Animation.cpp index f2dc5d3ad2..8454ea478c 100644 --- a/Userland/Libraries/LibWeb/Animations/Animation.cpp +++ b/Userland/Libraries/LibWeb/Animations/Animation.cpp @@ -1316,8 +1316,10 @@ JS::NonnullGCPtr Animation::current_finished_promise() const void Animation::invalidate_effect() { if (m_effect) { - if (auto target = m_effect->target(); target && target->paintable()) + if (auto target = m_effect->target(); target && target->paintable()) { + target->document().set_needs_animated_style_update(); target->paintable()->set_needs_display(); + } } } diff --git a/Userland/Libraries/LibWeb/DOM/Document.cpp b/Userland/Libraries/LibWeb/DOM/Document.cpp index 682a8b4a2f..b3d77c0db0 100644 --- a/Userland/Libraries/LibWeb/DOM/Document.cpp +++ b/Userland/Libraries/LibWeb/DOM/Document.cpp @@ -4064,8 +4064,6 @@ void Document::ensure_animation_timer() for (auto& animation : timeline->associated_animations()) dispatch_events_for_animation_if_necessary(animation); } - - m_needs_animated_style_update = true; })); } diff --git a/Userland/Libraries/LibWeb/DOM/Document.h b/Userland/Libraries/LibWeb/DOM/Document.h index c2e6a14504..5b3117edcd 100644 --- a/Userland/Libraries/LibWeb/DOM/Document.h +++ b/Userland/Libraries/LibWeb/DOM/Document.h @@ -597,6 +597,7 @@ public: JS::GCPtr scrolling_element() const; void set_needs_to_resolve_paint_only_properties() { m_needs_to_resolve_paint_only_properties = true; } + void set_needs_animated_style_update() { m_needs_animated_style_update = true; } virtual WebIDL::ExceptionOr named_item_value(FlyString const& name) const override; virtual Vector supported_property_names() const override;