瀏覽代碼

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.
Aliaksandr Kalenik 9 月之前
父節點
當前提交
32e79bd12e
共有 1 個文件被更改,包括 7 次插入3 次删除
  1. 7 3
      Userland/Libraries/LibWeb/Animations/Animation.cpp

+ 7 - 3
Userland/Libraries/LibWeb/Animations/Animation.cpp

@@ -1330,9 +1330,13 @@ JS::NonnullGCPtr<WebIDL::Promise> 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();
         }
     }