Title: [255593] trunk
Revision
255593
Author
[email protected]
Date
2020-02-03 14:16:46 -0800 (Mon, 03 Feb 2020)

Log Message

[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.

Modified Paths

Added Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (255592 => 255593)


--- trunk/LayoutTests/ChangeLog	2020-02-03 22:15:20 UTC (rev 255592)
+++ trunk/LayoutTests/ChangeLog	2020-02-03 22:16:46 UTC (rev 255593)
@@ -1,3 +1,23 @@
+2020-02-03  Antoine Quint  <[email protected]>
+
+        [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-03  Jacob Uphoff  <[email protected]>
 
         [ macOS wk1 ] inspector/canvas/recording-webgl-full.html  is flaky timing out

Modified: trunk/LayoutTests/compositing/geometry/limit-layer-bounds-opacity-transition.html (255592 => 255593)


--- trunk/LayoutTests/compositing/geometry/limit-layer-bounds-opacity-transition.html	2020-02-03 22:15:20 UTC (rev 255592)
+++ trunk/LayoutTests/compositing/geometry/limit-layer-bounds-opacity-transition.html	2020-02-03 22:16:46 UTC (rev 255593)
@@ -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: trunk/LayoutTests/webanimations/transform-accelerated-animation-finishes-before-removal-expected.txt (0 => 255593)


--- trunk/LayoutTests/webanimations/transform-accelerated-animation-finishes-before-removal-expected.txt	                        (rev 0)
+++ trunk/LayoutTests/webanimations/transform-accelerated-animation-finishes-before-removal-expected.txt	2020-02-03 22:16:46 UTC (rev 255593)
@@ -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: trunk/LayoutTests/webanimations/transform-accelerated-animation-finishes-before-removal.html (0 => 255593)


--- trunk/LayoutTests/webanimations/transform-accelerated-animation-finishes-before-removal.html	                        (rev 0)
+++ trunk/LayoutTests/webanimations/transform-accelerated-animation-finishes-before-removal.html	2020-02-03 22:16:46 UTC (rev 255593)
@@ -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: trunk/LayoutTests/webanimations/transform-accelerated-animation-removed-one-frame-after-finished-promise-expected.txt (0 => 255593)


--- trunk/LayoutTests/webanimations/transform-accelerated-animation-removed-one-frame-after-finished-promise-expected.txt	                        (rev 0)
+++ trunk/LayoutTests/webanimations/transform-accelerated-animation-removed-one-frame-after-finished-promise-expected.txt	2020-02-03 22:16:46 UTC (rev 255593)
@@ -0,0 +1 @@
+

Added: trunk/LayoutTests/webanimations/transform-accelerated-animation-removed-one-frame-after-finished-promise.html (0 => 255593)


--- trunk/LayoutTests/webanimations/transform-accelerated-animation-removed-one-frame-after-finished-promise.html	                        (rev 0)
+++ trunk/LayoutTests/webanimations/transform-accelerated-animation-removed-one-frame-after-finished-promise.html	2020-02-03 22:16:46 UTC (rev 255593)
@@ -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: trunk/Source/WebCore/ChangeLog (255592 => 255593)


--- trunk/Source/WebCore/ChangeLog	2020-02-03 22:15:20 UTC (rev 255592)
+++ trunk/Source/WebCore/ChangeLog	2020-02-03 22:16:46 UTC (rev 255593)
@@ -1,3 +1,23 @@
+2020-02-03  Antoine Quint  <[email protected]>
+
+        [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-03  Jer Noble  <[email protected]>
 
         [iPad] Videos on nhl.com can't be scrubbed when loaded with desktop UA.

Modified: trunk/Source/WebCore/animation/KeyframeEffect.cpp (255592 => 255593)


--- trunk/Source/WebCore/animation/KeyframeEffect.cpp	2020-02-03 22:15:20 UTC (rev 255592)
+++ trunk/Source/WebCore/animation/KeyframeEffect.cpp	2020-02-03 22:16:46 UTC (rev 255593)
@@ -1107,6 +1107,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: trunk/Source/WebCore/animation/KeyframeEffect.h (255592 => 255593)


--- trunk/Source/WebCore/animation/KeyframeEffect.h	2020-02-03 22:15:20 UTC (rev 255592)
+++ trunk/Source/WebCore/animation/KeyframeEffect.h	2020-02-03 22:16:46 UTC (rev 255593)
@@ -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: trunk/Source/WebCore/animation/KeyframeEffectStack.cpp (255592 => 255593)


--- trunk/Source/WebCore/animation/KeyframeEffectStack.cpp	2020-02-03 22:15:20 UTC (rev 255592)
+++ trunk/Source/WebCore/animation/KeyframeEffectStack.cpp	2020-02-03 22:16:46 UTC (rev 255593)
@@ -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
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to