Title: [261635] trunk/Source/WebCore
Revision
261635
Author
[email protected]
Date
2020-05-13 12:18:23 -0700 (Wed, 13 May 2020)

Log Message

[Web Animations] Fix refactoring issue with animation suspension following r261336
https://bugs.webkit.org/show_bug.cgi?id=211842
<rdar://problem/63118326>

Patch by Antoine Quint <[email protected]> on 2020-05-13
Reviewed by Dean Jackson.

We moved up the suspension code up from DocumentTimeline to DocumentTimelinesController in r261336
and forgot to move the code that set the initial suspension state from the DocumentTimeline constructor
to the DocumentTimelinesController constructor. This is problematic because the suspension state is
only recorded on DocumentTimelinesController itself.

* animation/DocumentTimeline.cpp:
(WebCore::DocumentTimeline::DocumentTimeline):
* animation/DocumentTimelinesController.cpp:
(WebCore::DocumentTimelinesController::DocumentTimelinesController):
(WebCore::DocumentTimelinesController::addTimeline):

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (261634 => 261635)


--- trunk/Source/WebCore/ChangeLog	2020-05-13 19:16:05 UTC (rev 261634)
+++ trunk/Source/WebCore/ChangeLog	2020-05-13 19:18:23 UTC (rev 261635)
@@ -1,3 +1,22 @@
+2020-05-13  Antoine Quint  <[email protected]>
+
+        [Web Animations] Fix refactoring issue with animation suspension following r261336
+        https://bugs.webkit.org/show_bug.cgi?id=211842
+        <rdar://problem/63118326>
+
+        Reviewed by Dean Jackson.
+
+        We moved up the suspension code up from DocumentTimeline to DocumentTimelinesController in r261336
+        and forgot to move the code that set the initial suspension state from the DocumentTimeline constructor
+        to the DocumentTimelinesController constructor. This is problematic because the suspension state is
+        only recorded on DocumentTimelinesController itself.
+
+        * animation/DocumentTimeline.cpp:
+        (WebCore::DocumentTimeline::DocumentTimeline):
+        * animation/DocumentTimelinesController.cpp:
+        (WebCore::DocumentTimelinesController::DocumentTimelinesController):
+        (WebCore::DocumentTimelinesController::addTimeline):
+
 2020-05-13  Simon Fraser  <[email protected]>
 
         composited scrolling interferes with the propagation of perspective

Modified: trunk/Source/WebCore/animation/DocumentTimeline.cpp (261634 => 261635)


--- trunk/Source/WebCore/animation/DocumentTimeline.cpp	2020-05-13 19:16:05 UTC (rev 261634)
+++ trunk/Source/WebCore/animation/DocumentTimeline.cpp	2020-05-13 19:18:23 UTC (rev 261635)
@@ -40,7 +40,6 @@
 #include "RenderElement.h"
 #include "RenderLayer.h"
 #include "RenderLayerBacking.h"
-#include "Settings.h"
 
 namespace WebCore {
 
@@ -62,10 +61,6 @@
 {
     if (auto* controller = this->controller())
         controller->addTimeline(*this);
-    if (auto* page = document.page()) {
-        if (page->settings().hiddenPageCSSAnimationSuspensionEnabled() && !page->isVisible())
-            suspendAnimations();
-    }
 }
 
 DocumentTimeline::~DocumentTimeline()

Modified: trunk/Source/WebCore/animation/DocumentTimelinesController.cpp (261634 => 261635)


--- trunk/Source/WebCore/animation/DocumentTimelinesController.cpp	2020-05-13 19:16:05 UTC (rev 261634)
+++ trunk/Source/WebCore/animation/DocumentTimelinesController.cpp	2020-05-13 19:18:23 UTC (rev 261635)
@@ -32,6 +32,8 @@
 #include "Document.h"
 #include "DocumentTimeline.h"
 #include "EventLoop.h"
+#include "Page.h"
+#include "Settings.h"
 #include "WebAnimation.h"
 #include "WebAnimationTypes.h"
 #include <_javascript_Core/VM.h>
@@ -41,6 +43,10 @@
 DocumentTimelinesController::DocumentTimelinesController(Document& document)
     : m_document(document)
 {
+    if (auto* page = document.page()) {
+        if (page->settings().hiddenPageCSSAnimationSuspensionEnabled() && !page->isVisible())
+            suspendAnimations();
+    }
 }
 
 DocumentTimelinesController::~DocumentTimelinesController()
@@ -50,6 +56,11 @@
 void DocumentTimelinesController::addTimeline(DocumentTimeline& timeline)
 {
     m_timelines.add(timeline);
+
+    if (m_isSuspended)
+        timeline.suspendAnimations();
+    else
+        timeline.resumeAnimations();
 }
 
 void DocumentTimelinesController::removeTimeline(DocumentTimeline& timeline)
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to