From 32e79bd12e73a7530814c52a17efa72f99edcb3f Mon Sep 17 00:00:00 2001 From: Aliaksandr Kalenik Date: Thu, 3 Oct 2024 17:36:06 +0200 Subject: [PATCH] LibWeb: Invalidate animated style even if target doesn't have paintable ...otherwise animated style invalidation will be skipped. This change is a preparation before applying latest HTML event loop procesing spec changes to avoid regressing our tests. --- Userland/Libraries/LibWeb/Animations/Animation.cpp | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/Userland/Libraries/LibWeb/Animations/Animation.cpp b/Userland/Libraries/LibWeb/Animations/Animation.cpp index d218c5c40b4..da37fa38fd6 100644 --- a/Userland/Libraries/LibWeb/Animations/Animation.cpp +++ b/Userland/Libraries/LibWeb/Animations/Animation.cpp @@ -1330,9 +1330,13 @@ JS::NonnullGCPtr Animation::current_finished_promise() const void Animation::invalidate_effect() { - if (m_effect) { - if (auto target = m_effect->target(); target && target->paintable()) { - target->document().set_needs_animated_style_update(); + if (!m_effect) { + return; + } + + if (auto* target = m_effect->target(); target) { + target->document().set_needs_animated_style_update(); + if (target->paintable()) { target->paintable()->set_needs_display(); } }