Title: [255655] branches/safari-610.1.1-branch/Source/WebCore
Revision
255655
Author
[email protected]
Date
2020-02-03 19:10:19 -0800 (Mon, 03 Feb 2020)

Log Message

Cherry-pick r255489. rdar://problem/58815952

    [Web Animations] DocumentTimeline shouldn't suspend itself if hiddenPageCSSAnimationSuspensionEnabled is disabled
    https://bugs.webkit.org/show_bug.cgi?id=207014
    <rdar://problem/58815952>

    Reviewed by Antti Koivisto.

    We suspend a timeline upon consutrction if we know that the page is not visible because, unlike CSSAnimationController, the DocumentTimeline is not guaranteed
    to be created by the time the Page sets the initial visibility state. This is because DocumentTimeline is created as needed when there are CSS Animations or CSS
    Transitions created for the page, or if the content uses any of the Web Animations APIs.

    However, the Page::setIsVisibleInternal() function that would call DocumentTimeline::resumeAnimations() at a later time checks whether the hiddenPageCSSAnimationSuspensionEnabled
    setting is enabled. So we must respect that setting also when suspending animations in the first place or we risk ending up in a state where we suspend animations
    because the page is not visible upon timeline creation, but never resuming animations later due to the hiddenPageCSSAnimationSuspensionEnabled setting being false.

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

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

Modified Paths

Diff

Modified: branches/safari-610.1.1-branch/Source/WebCore/ChangeLog (255654 => 255655)


--- branches/safari-610.1.1-branch/Source/WebCore/ChangeLog	2020-02-04 03:10:17 UTC (rev 255654)
+++ branches/safari-610.1.1-branch/Source/WebCore/ChangeLog	2020-02-04 03:10:19 UTC (rev 255655)
@@ -1,5 +1,47 @@
 2020-02-03  Alan Coon  <[email protected]>
 
+        Cherry-pick r255489. rdar://problem/58815952
+
+    [Web Animations] DocumentTimeline shouldn't suspend itself if hiddenPageCSSAnimationSuspensionEnabled is disabled
+    https://bugs.webkit.org/show_bug.cgi?id=207014
+    <rdar://problem/58815952>
+    
+    Reviewed by Antti Koivisto.
+    
+    We suspend a timeline upon consutrction if we know that the page is not visible because, unlike CSSAnimationController, the DocumentTimeline is not guaranteed
+    to be created by the time the Page sets the initial visibility state. This is because DocumentTimeline is created as needed when there are CSS Animations or CSS
+    Transitions created for the page, or if the content uses any of the Web Animations APIs.
+    
+    However, the Page::setIsVisibleInternal() function that would call DocumentTimeline::resumeAnimations() at a later time checks whether the hiddenPageCSSAnimationSuspensionEnabled
+    setting is enabled. So we must respect that setting also when suspending animations in the first place or we risk ending up in a state where we suspend animations
+    because the page is not visible upon timeline creation, but never resuming animations later due to the hiddenPageCSSAnimationSuspensionEnabled setting being false.
+    
+    * animation/DocumentTimeline.cpp:
+    (WebCore::DocumentTimeline::DocumentTimeline):
+    
+    git-svn-id: https://svn.webkit.org/repository/webkit/trunk@255489 268f45cc-cd09-0410-ab3c-d52691b4dbfc
+
+    2020-01-30  Antoine Quint  <[email protected]>
+
+            [Web Animations] DocumentTimeline shouldn't suspend itself if hiddenPageCSSAnimationSuspensionEnabled is disabled
+            https://bugs.webkit.org/show_bug.cgi?id=207014
+            <rdar://problem/58815952>
+
+            Reviewed by Antti Koivisto.
+
+            We suspend a timeline upon consutrction if we know that the page is not visible because, unlike CSSAnimationController, the DocumentTimeline is not guaranteed
+            to be created by the time the Page sets the initial visibility state. This is because DocumentTimeline is created as needed when there are CSS Animations or CSS
+            Transitions created for the page, or if the content uses any of the Web Animations APIs.
+
+            However, the Page::setIsVisibleInternal() function that would call DocumentTimeline::resumeAnimations() at a later time checks whether the hiddenPageCSSAnimationSuspensionEnabled
+            setting is enabled. So we must respect that setting also when suspending animations in the first place or we risk ending up in a state where we suspend animations
+            because the page is not visible upon timeline creation, but never resuming animations later due to the hiddenPageCSSAnimationSuspensionEnabled setting being false.
+
+            * animation/DocumentTimeline.cpp:
+            (WebCore::DocumentTimeline::DocumentTimeline):
+
+2020-02-03  Alan Coon  <[email protected]>
+
         Cherry-pick r255420. rdar://problem/58858225
 
     REGRESSION (r254406): Gmail.com star/favorite icons are not rendering

Modified: branches/safari-610.1.1-branch/Source/WebCore/animation/DocumentTimeline.cpp (255654 => 255655)


--- branches/safari-610.1.1-branch/Source/WebCore/animation/DocumentTimeline.cpp	2020-02-04 03:10:17 UTC (rev 255654)
+++ branches/safari-610.1.1-branch/Source/WebCore/animation/DocumentTimeline.cpp	2020-02-04 03:10:19 UTC (rev 255655)
@@ -42,6 +42,7 @@
 #include "RenderElement.h"
 #include "RenderLayer.h"
 #include "RenderLayerBacking.h"
+#include "Settings.h"
 #include <_javascript_Core/VM.h>
 
 static const Seconds defaultAnimationInterval { 15_ms };
@@ -65,10 +66,13 @@
     , m_document(&document)
     , m_originTime(originTime)
 {
-    if (m_document)
+    if (m_document) {
         m_document->addTimeline(*this);
-    if (m_document && m_document->page() && !m_document->page()->isVisible())
-        suspendAnimations();
+        if (auto* page = m_document->page()) {
+            if (page->settings().hiddenPageCSSAnimationSuspensionEnabled() && !page->isVisible())
+                suspendAnimations();
+        }
+    }
 }
 
 DocumentTimeline::~DocumentTimeline()
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to