Title: [261650] branches/safari-610.1.13-branch/Source/WebCore
Revision
261650
Author
alanc...@apple.com
Date
2020-05-13 13:47:27 -0700 (Wed, 13 May 2020)

Log Message

Cherry-pick r261635. rdar://problem/63195707

    [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 <grao...@apple.com> 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):

    git-svn-id: https://svn.webkit.org/repository/webkit/trunk@261635 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Modified Paths

Diff

Modified: branches/safari-610.1.13-branch/Source/WebCore/ChangeLog (261649 => 261650)


--- branches/safari-610.1.13-branch/Source/WebCore/ChangeLog	2020-05-13 20:47:25 UTC (rev 261649)
+++ branches/safari-610.1.13-branch/Source/WebCore/ChangeLog	2020-05-13 20:47:27 UTC (rev 261650)
@@ -1,5 +1,48 @@
 2020-05-13  Alan Coon  <alanc...@apple.com>
 
+        Cherry-pick r261635. rdar://problem/63195707
+
+    [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 <grao...@apple.com> 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):
+    
+    git-svn-id: https://svn.webkit.org/repository/webkit/trunk@261635 268f45cc-cd09-0410-ab3c-d52691b4dbfc
+
+    2020-05-13  Antoine Quint  <grao...@apple.com>
+
+            [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  Alan Coon  <alanc...@apple.com>
+
         Cherry-pick r261587. rdar://problem/63195680
 
     [iOS] REGRESSION: (r261342) Play/pause button doesn't work upon first entering fullscreen mode

Modified: branches/safari-610.1.13-branch/Source/WebCore/animation/DocumentTimeline.cpp (261649 => 261650)


--- branches/safari-610.1.13-branch/Source/WebCore/animation/DocumentTimeline.cpp	2020-05-13 20:47:25 UTC (rev 261649)
+++ branches/safari-610.1.13-branch/Source/WebCore/animation/DocumentTimeline.cpp	2020-05-13 20:47:27 UTC (rev 261650)
@@ -42,7 +42,6 @@
 #include "RenderElement.h"
 #include "RenderLayer.h"
 #include "RenderLayerBacking.h"
-#include "Settings.h"
 
 namespace WebCore {
 
@@ -64,10 +63,6 @@
 {
     if (auto* controller = this->controller())
         controller->addTimeline(*this);
-    if (auto* page = document.page()) {
-        if (page->settings().hiddenPageCSSAnimationSuspensionEnabled() && !page->isVisible())
-            suspendAnimations();
-    }
 }
 
 DocumentTimeline::~DocumentTimeline()

Modified: branches/safari-610.1.13-branch/Source/WebCore/animation/DocumentTimelinesController.cpp (261649 => 261650)


--- branches/safari-610.1.13-branch/Source/WebCore/animation/DocumentTimelinesController.cpp	2020-05-13 20:47:25 UTC (rev 261649)
+++ branches/safari-610.1.13-branch/Source/WebCore/animation/DocumentTimelinesController.cpp	2020-05-13 20:47:27 UTC (rev 261650)
@@ -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
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to