Title: [256337] branches/safari-609.1.17.0-branch
Revision
256337
Author
repst...@apple.com
Date
2020-02-11 12:48:45 -0800 (Tue, 11 Feb 2020)

Log Message

Cherry-pick r255593. rdar://problem/59349198

    [Web Animations] Accelerated animations don't run until their natural completion
    https://bugs.webkit.org/show_bug.cgi?id=207130
    <rdar://problem/59106047>

    Reviewed by Dean Jackson.

    Source/WebCore:

    Tests: webanimations/transform-accelerated-animation-finishes-before-removal.html
           webanimations/transform-accelerated-animation-removed-one-frame-after-finished-promise.html

    Ensure we don't tear down a composited renderer until all of its runnning accelerated animations are completed.
    The accelerated animations will be queued for removal in the next animation frame.

    * animation/KeyframeEffect.cpp:
    (WebCore::KeyframeEffect::isRunningAcceleratedAnimationForProperty const):
    * animation/KeyframeEffect.h:
    * animation/KeyframeEffectStack.cpp:
    (WebCore::KeyframeEffectStack::isCurrentlyAffectingProperty const):

    LayoutTests:

    Add two new tests that ensures that an accelerated animation still yields compositing on an element when
    its finished promise is resolved, but that it's no longer the case on the next frame.

    This required an existing test to be updated to wait until the next frame before checking the composited
    status of an element on which an animation had just completed.

    * compositing/geometry/limit-layer-bounds-opacity-transition.html:
    * webanimations/transform-accelerated-animation-finishes-before-removal-expected.txt: Added.
    * webanimations/transform-accelerated-animation-finishes-before-removal.html: Added.
    * webanimations/transform-accelerated-animation-removed-one-frame-after-finished-promise-expected.txt: Added.
    * webanimations/transform-accelerated-animation-removed-one-frame-after-finished-promise.html: Added.

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

Modified Paths

Added Paths

Diff

Modified: branches/safari-609.1.17.0-branch/LayoutTests/ChangeLog (256336 => 256337)


--- branches/safari-609.1.17.0-branch/LayoutTests/ChangeLog	2020-02-11 20:48:40 UTC (rev 256336)
+++ branches/safari-609.1.17.0-branch/LayoutTests/ChangeLog	2020-02-11 20:48:45 UTC (rev 256337)
@@ -1,5 +1,65 @@
 2020-02-11  Russell Epstein  <repst...@apple.com>
 
+        Cherry-pick r255593. rdar://problem/59349198
+
+    [Web Animations] Accelerated animations don't run until their natural completion
+    https://bugs.webkit.org/show_bug.cgi?id=207130
+    <rdar://problem/59106047>
+    
+    Reviewed by Dean Jackson.
+    
+    Source/WebCore:
+    
+    Tests: webanimations/transform-accelerated-animation-finishes-before-removal.html
+           webanimations/transform-accelerated-animation-removed-one-frame-after-finished-promise.html
+    
+    Ensure we don't tear down a composited renderer until all of its runnning accelerated animations are completed.
+    The accelerated animations will be queued for removal in the next animation frame.
+    
+    * animation/KeyframeEffect.cpp:
+    (WebCore::KeyframeEffect::isRunningAcceleratedAnimationForProperty const):
+    * animation/KeyframeEffect.h:
+    * animation/KeyframeEffectStack.cpp:
+    (WebCore::KeyframeEffectStack::isCurrentlyAffectingProperty const):
+    
+    LayoutTests:
+    
+    Add two new tests that ensures that an accelerated animation still yields compositing on an element when
+    its finished promise is resolved, but that it's no longer the case on the next frame.
+    
+    This required an existing test to be updated to wait until the next frame before checking the composited
+    status of an element on which an animation had just completed.
+    
+    * compositing/geometry/limit-layer-bounds-opacity-transition.html:
+    * webanimations/transform-accelerated-animation-finishes-before-removal-expected.txt: Added.
+    * webanimations/transform-accelerated-animation-finishes-before-removal.html: Added.
+    * webanimations/transform-accelerated-animation-removed-one-frame-after-finished-promise-expected.txt: Added.
+    * webanimations/transform-accelerated-animation-removed-one-frame-after-finished-promise.html: Added.
+    
+    git-svn-id: https://svn.webkit.org/repository/webkit/trunk@255593 268f45cc-cd09-0410-ab3c-d52691b4dbfc
+
+    2020-02-03  Antoine Quint  <grao...@apple.com>
+
+            [Web Animations] Accelerated animations don't run until their natural completion
+            https://bugs.webkit.org/show_bug.cgi?id=207130
+            <rdar://problem/59106047>
+
+            Reviewed by Dean Jackson.
+
+            Add two new tests that ensures that an accelerated animation still yields compositing on an element when
+            its finished promise is resolved, but that it's no longer the case on the next frame.
+
+            This required an existing test to be updated to wait until the next frame before checking the composited
+            status of an element on which an animation had just completed.
+
+            * compositing/geometry/limit-layer-bounds-opacity-transition.html:
+            * webanimations/transform-accelerated-animation-finishes-before-removal-expected.txt: Added.
+            * webanimations/transform-accelerated-animation-finishes-before-removal.html: Added.
+            * webanimations/transform-accelerated-animation-removed-one-frame-after-finished-promise-expected.txt: Added.
+            * webanimations/transform-accelerated-animation-removed-one-frame-after-finished-promise.html: Added.
+
+2020-02-11  Russell Epstein  <repst...@apple.com>
+
         Cherry-pick r255552. rdar://problem/59349213
 
     ASSERTION FAILED: !HashTranslator::equal(KeyTraits::emptyValue(), key) on animations/keyframe-autoclose-brace.html

Modified: branches/safari-609.1.17.0-branch/LayoutTests/compositing/geometry/limit-layer-bounds-opacity-transition.html (256336 => 256337)


--- branches/safari-609.1.17.0-branch/LayoutTests/compositing/geometry/limit-layer-bounds-opacity-transition.html	2020-02-11 20:48:40 UTC (rev 256336)
+++ branches/safari-609.1.17.0-branch/LayoutTests/compositing/geometry/limit-layer-bounds-opacity-transition.html	2020-02-11 20:48:45 UTC (rev 256337)
@@ -40,8 +40,10 @@
     function fadeDone()
     {
       if (window.testRunner) {
-        document.getElementById('layers').innerText = window.internals.layerTreeAsText(document);
-        testRunner.notifyDone();
+          requestAnimationFrame(() => {
+              document.getElementById('layers').innerText = window.internals.layerTreeAsText(document);
+              testRunner.notifyDone();
+          })
       }
     }
   </script>

Added: branches/safari-609.1.17.0-branch/LayoutTests/webanimations/transform-accelerated-animation-finishes-before-removal-expected.txt (0 => 256337)


--- branches/safari-609.1.17.0-branch/LayoutTests/webanimations/transform-accelerated-animation-finishes-before-removal-expected.txt	                        (rev 0)
+++ branches/safari-609.1.17.0-branch/LayoutTests/webanimations/transform-accelerated-animation-finishes-before-removal-expected.txt	2020-02-11 20:48:45 UTC (rev 256337)
@@ -0,0 +1,18 @@
+(GraphicsLayer
+  (anchor 0.00 0.00)
+  (bounds 800.00 600.00)
+  (children 1
+    (GraphicsLayer
+      (bounds 800.00 600.00)
+      (contentsOpaque 1)
+      (children 1
+        (GraphicsLayer
+          (position 8.00 8.00)
+          (bounds 100.00 100.00)
+          (contentsOpaque 1)
+        )
+      )
+    )
+  )
+)
+

Added: branches/safari-609.1.17.0-branch/LayoutTests/webanimations/transform-accelerated-animation-finishes-before-removal.html (0 => 256337)


--- branches/safari-609.1.17.0-branch/LayoutTests/webanimations/transform-accelerated-animation-finishes-before-removal.html	                        (rev 0)
+++ branches/safari-609.1.17.0-branch/LayoutTests/webanimations/transform-accelerated-animation-finishes-before-removal.html	2020-02-11 20:48:45 UTC (rev 256337)
@@ -0,0 +1,16 @@
+<pre id="results"></pre>
+<div id="target" style="width: 100px; height: 100px; background-color: black;"></div>
+<script>
+
+testRunner.waitUntilDone();
+testRunner.dumpAsText();
+
+document.getElementById("target").animate([
+    { transform: "translateX(0)" },
+    { transform: "translateX(100px)" }
+], 100).finished.then(() => {
+    document.getElementById("results").innerText = internals.layerTreeAsText(document);
+    testRunner.notifyDone();
+});
+
+</script>

Added: branches/safari-609.1.17.0-branch/LayoutTests/webanimations/transform-accelerated-animation-removed-one-frame-after-finished-promise-expected.txt (0 => 256337)


--- branches/safari-609.1.17.0-branch/LayoutTests/webanimations/transform-accelerated-animation-removed-one-frame-after-finished-promise-expected.txt	                        (rev 0)
+++ branches/safari-609.1.17.0-branch/LayoutTests/webanimations/transform-accelerated-animation-removed-one-frame-after-finished-promise-expected.txt	2020-02-11 20:48:45 UTC (rev 256337)
@@ -0,0 +1 @@
+

Added: branches/safari-609.1.17.0-branch/LayoutTests/webanimations/transform-accelerated-animation-removed-one-frame-after-finished-promise.html (0 => 256337)


--- branches/safari-609.1.17.0-branch/LayoutTests/webanimations/transform-accelerated-animation-removed-one-frame-after-finished-promise.html	                        (rev 0)
+++ branches/safari-609.1.17.0-branch/LayoutTests/webanimations/transform-accelerated-animation-removed-one-frame-after-finished-promise.html	2020-02-11 20:48:45 UTC (rev 256337)
@@ -0,0 +1,18 @@
+<pre id="results"></pre>
+<div id="target" style="width: 100px; height: 100px; background-color: black;"></div>
+<script>
+
+testRunner.waitUntilDone();
+testRunner.dumpAsText();
+
+document.getElementById("target").animate([
+    { transform: "translateX(0)" },
+    { transform: "translateX(100px)" }
+], 100).finished.then(() => {
+    requestAnimationFrame(() => {
+        document.getElementById("results").innerText = internals.layerTreeAsText(document);
+        testRunner.notifyDone();
+    });
+});
+
+</script>

Modified: branches/safari-609.1.17.0-branch/Source/WebCore/ChangeLog (256336 => 256337)


--- branches/safari-609.1.17.0-branch/Source/WebCore/ChangeLog	2020-02-11 20:48:40 UTC (rev 256336)
+++ branches/safari-609.1.17.0-branch/Source/WebCore/ChangeLog	2020-02-11 20:48:45 UTC (rev 256337)
@@ -1,5 +1,65 @@
 2020-02-11  Russell Epstein  <repst...@apple.com>
 
+        Cherry-pick r255593. rdar://problem/59349198
+
+    [Web Animations] Accelerated animations don't run until their natural completion
+    https://bugs.webkit.org/show_bug.cgi?id=207130
+    <rdar://problem/59106047>
+    
+    Reviewed by Dean Jackson.
+    
+    Source/WebCore:
+    
+    Tests: webanimations/transform-accelerated-animation-finishes-before-removal.html
+           webanimations/transform-accelerated-animation-removed-one-frame-after-finished-promise.html
+    
+    Ensure we don't tear down a composited renderer until all of its runnning accelerated animations are completed.
+    The accelerated animations will be queued for removal in the next animation frame.
+    
+    * animation/KeyframeEffect.cpp:
+    (WebCore::KeyframeEffect::isRunningAcceleratedAnimationForProperty const):
+    * animation/KeyframeEffect.h:
+    * animation/KeyframeEffectStack.cpp:
+    (WebCore::KeyframeEffectStack::isCurrentlyAffectingProperty const):
+    
+    LayoutTests:
+    
+    Add two new tests that ensures that an accelerated animation still yields compositing on an element when
+    its finished promise is resolved, but that it's no longer the case on the next frame.
+    
+    This required an existing test to be updated to wait until the next frame before checking the composited
+    status of an element on which an animation had just completed.
+    
+    * compositing/geometry/limit-layer-bounds-opacity-transition.html:
+    * webanimations/transform-accelerated-animation-finishes-before-removal-expected.txt: Added.
+    * webanimations/transform-accelerated-animation-finishes-before-removal.html: Added.
+    * webanimations/transform-accelerated-animation-removed-one-frame-after-finished-promise-expected.txt: Added.
+    * webanimations/transform-accelerated-animation-removed-one-frame-after-finished-promise.html: Added.
+    
+    git-svn-id: https://svn.webkit.org/repository/webkit/trunk@255593 268f45cc-cd09-0410-ab3c-d52691b4dbfc
+
+    2020-02-03  Antoine Quint  <grao...@apple.com>
+
+            [Web Animations] Accelerated animations don't run until their natural completion
+            https://bugs.webkit.org/show_bug.cgi?id=207130
+            <rdar://problem/59106047>
+
+            Reviewed by Dean Jackson.
+
+            Tests: webanimations/transform-accelerated-animation-finishes-before-removal.html
+                   webanimations/transform-accelerated-animation-removed-one-frame-after-finished-promise.html
+
+            Ensure we don't tear down a composited renderer until all of its runnning accelerated animations are completed.
+            The accelerated animations will be queued for removal in the next animation frame.
+
+            * animation/KeyframeEffect.cpp:
+            (WebCore::KeyframeEffect::isRunningAcceleratedAnimationForProperty const):
+            * animation/KeyframeEffect.h:
+            * animation/KeyframeEffectStack.cpp:
+            (WebCore::KeyframeEffectStack::isCurrentlyAffectingProperty const):
+
+2020-02-11  Russell Epstein  <repst...@apple.com>
+
         Cherry-pick r255552. rdar://problem/59349213
 
     ASSERTION FAILED: !HashTranslator::equal(KeyTraits::emptyValue(), key) on animations/keyframe-autoclose-brace.html

Modified: branches/safari-609.1.17.0-branch/Source/WebCore/animation/KeyframeEffect.cpp (256336 => 256337)


--- branches/safari-609.1.17.0-branch/Source/WebCore/animation/KeyframeEffect.cpp	2020-02-11 20:48:40 UTC (rev 256336)
+++ branches/safari-609.1.17.0-branch/Source/WebCore/animation/KeyframeEffect.cpp	2020-02-11 20:48:45 UTC (rev 256337)
@@ -1105,6 +1105,11 @@
     return m_phaseAtLastApplication == AnimationEffectPhase::Active;
 }
 
+bool KeyframeEffect::isRunningAcceleratedAnimationForProperty(CSSPropertyID property) const
+{
+    return m_isRunningAccelerated && CSSPropertyAnimation::animationOfPropertyIsAccelerated(property) && m_blendingKeyframes.properties().contains(property);
+}
+
 void KeyframeEffect::invalidate()
 {
     invalidateElement(m_target.get());

Modified: branches/safari-609.1.17.0-branch/Source/WebCore/animation/KeyframeEffect.h (256336 => 256337)


--- branches/safari-609.1.17.0-branch/Source/WebCore/animation/KeyframeEffect.h	2020-02-11 20:48:40 UTC (rev 256336)
+++ branches/safari-609.1.17.0-branch/Source/WebCore/animation/KeyframeEffect.h	2020-02-11 20:48:45 UTC (rev 256337)
@@ -148,6 +148,7 @@
 
     enum class Accelerated : uint8_t { Yes, No };
     bool isCurrentlyAffectingProperty(CSSPropertyID, Accelerated = Accelerated::No) const;
+    bool isRunningAcceleratedAnimationForProperty(CSSPropertyID) const;
 
 private:
     KeyframeEffect(Element*);

Modified: branches/safari-609.1.17.0-branch/Source/WebCore/animation/KeyframeEffectStack.cpp (256336 => 256337)


--- branches/safari-609.1.17.0-branch/Source/WebCore/animation/KeyframeEffectStack.cpp	2020-02-11 20:48:40 UTC (rev 256336)
+++ branches/safari-609.1.17.0-branch/Source/WebCore/animation/KeyframeEffectStack.cpp	2020-02-11 20:48:45 UTC (rev 256337)
@@ -63,7 +63,7 @@
 bool KeyframeEffectStack::isCurrentlyAffectingProperty(CSSPropertyID property) const
 {
     for (auto& effect : m_effects) {
-        if (effect->isCurrentlyAffectingProperty(property))
+        if (effect->isCurrentlyAffectingProperty(property) || effect->isRunningAcceleratedAnimationForProperty(property))
             return true;
     }
     return false;
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to