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

Log Message

Cherry-pick r255504. rdar://problem/59061225

    [Web Animations] [WK1] REGRESSION: opacity doesn't animate
    https://bugs.webkit.org/show_bug.cgi?id=207044
    <rdar://problem/59061225>

    Reviewed by Simon Fraser.

    Source/WebCore:

    Test: webanimations/opacity-animation.html

    We failed to animate opacity in WK1 because we made the assumption that just because an animation targets only accelerated properties it would be accelerated
    and wouldn't need to be updated as it runs in WebAnimation::timeToNextTick(). This is incorrect, an animation may fail to start or may fail to get a composited
    layer, the latter being the case on WK1 because usesCompositing() is false in RenderLayerCompositor::requiresCompositingForAnimation().

    We now check that an animation is both only animating accelerated properties and running accelerated to determine that an animation won't need to be updated
    until it completes.

    * animation/WebAnimation.cpp:
    (WebCore::WebAnimation::timeToNextTick const):

    LayoutTests:

    * webanimations/opacity-animation-expected.html: Added.
    * webanimations/opacity-animation.html: Added.

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

Modified Paths

Added Paths

Diff

Modified: branches/safari-610.1.1-branch/LayoutTests/ChangeLog (255656 => 255657)


--- branches/safari-610.1.1-branch/LayoutTests/ChangeLog	2020-02-04 03:10:22 UTC (rev 255656)
+++ branches/safari-610.1.1-branch/LayoutTests/ChangeLog	2020-02-04 03:10:25 UTC (rev 255657)
@@ -1,5 +1,47 @@
 2020-02-03  Alan Coon  <[email protected]>
 
+        Cherry-pick r255504. rdar://problem/59061225
+
+    [Web Animations] [WK1] REGRESSION: opacity doesn't animate
+    https://bugs.webkit.org/show_bug.cgi?id=207044
+    <rdar://problem/59061225>
+    
+    Reviewed by Simon Fraser.
+    
+    Source/WebCore:
+    
+    Test: webanimations/opacity-animation.html
+    
+    We failed to animate opacity in WK1 because we made the assumption that just because an animation targets only accelerated properties it would be accelerated
+    and wouldn't need to be updated as it runs in WebAnimation::timeToNextTick(). This is incorrect, an animation may fail to start or may fail to get a composited
+    layer, the latter being the case on WK1 because usesCompositing() is false in RenderLayerCompositor::requiresCompositingForAnimation().
+    
+    We now check that an animation is both only animating accelerated properties and running accelerated to determine that an animation won't need to be updated
+    until it completes.
+    
+    * animation/WebAnimation.cpp:
+    (WebCore::WebAnimation::timeToNextTick const):
+    
+    LayoutTests:
+    
+    * webanimations/opacity-animation-expected.html: Added.
+    * webanimations/opacity-animation.html: Added.
+    
+    git-svn-id: https://svn.webkit.org/repository/webkit/trunk@255504 268f45cc-cd09-0410-ab3c-d52691b4dbfc
+
+    2020-01-31  Antoine Quint  <[email protected]>
+
+            [Web Animations] [WK1] REGRESSION: opacity doesn't animate
+            https://bugs.webkit.org/show_bug.cgi?id=207044
+            <rdar://problem/59061225>
+
+            Reviewed by Simon Fraser.
+
+            * webanimations/opacity-animation-expected.html: Added.
+            * webanimations/opacity-animation.html: Added.
+
+2020-02-03  Alan Coon  <[email protected]>
+
         Cherry-pick r255420. rdar://problem/58858225
 
     REGRESSION (r254406): Gmail.com star/favorite icons are not rendering

Added: branches/safari-610.1.1-branch/LayoutTests/webanimations/opacity-animation-expected.html (0 => 255657)


--- branches/safari-610.1.1-branch/LayoutTests/webanimations/opacity-animation-expected.html	                        (rev 0)
+++ branches/safari-610.1.1-branch/LayoutTests/webanimations/opacity-animation-expected.html	2020-02-04 03:10:25 UTC (rev 255657)
@@ -0,0 +1 @@
+<div style="position: absolute; top: 0; left: 0; width: 100px; height: 100px; background-color: black; opacity: 0.5;"></div>

Added: branches/safari-610.1.1-branch/LayoutTests/webanimations/opacity-animation.html (0 => 255657)


--- branches/safari-610.1.1-branch/LayoutTests/webanimations/opacity-animation.html	                        (rev 0)
+++ branches/safari-610.1.1-branch/LayoutTests/webanimations/opacity-animation.html	2020-02-04 03:10:25 UTC (rev 255657)
@@ -0,0 +1,19 @@
+<div style="position: absolute; top: 0; left: 0; width: 100px; height: 100px; background-color: black;"></div>
+<script>
+
+if (window.testRunner)
+    testRunner.waitUntilDone();
+
+const animation = document.querySelector("div").animate([
+    { opacity: 0 },
+    { opacity: 0.5, offset: 0.001 },
+    { opacity: 0.5 }
+], 1000);
+
+if (window.testRunner) {
+    animation.ready.then(() => {
+        setTimeout(() => testRunner.notifyDone(), 100);
+    });
+}
+
+</script>

Modified: branches/safari-610.1.1-branch/Source/WebCore/ChangeLog (255656 => 255657)


--- branches/safari-610.1.1-branch/Source/WebCore/ChangeLog	2020-02-04 03:10:22 UTC (rev 255656)
+++ branches/safari-610.1.1-branch/Source/WebCore/ChangeLog	2020-02-04 03:10:25 UTC (rev 255657)
@@ -1,5 +1,56 @@
 2020-02-03  Alan Coon  <[email protected]>
 
+        Cherry-pick r255504. rdar://problem/59061225
+
+    [Web Animations] [WK1] REGRESSION: opacity doesn't animate
+    https://bugs.webkit.org/show_bug.cgi?id=207044
+    <rdar://problem/59061225>
+    
+    Reviewed by Simon Fraser.
+    
+    Source/WebCore:
+    
+    Test: webanimations/opacity-animation.html
+    
+    We failed to animate opacity in WK1 because we made the assumption that just because an animation targets only accelerated properties it would be accelerated
+    and wouldn't need to be updated as it runs in WebAnimation::timeToNextTick(). This is incorrect, an animation may fail to start or may fail to get a composited
+    layer, the latter being the case on WK1 because usesCompositing() is false in RenderLayerCompositor::requiresCompositingForAnimation().
+    
+    We now check that an animation is both only animating accelerated properties and running accelerated to determine that an animation won't need to be updated
+    until it completes.
+    
+    * animation/WebAnimation.cpp:
+    (WebCore::WebAnimation::timeToNextTick const):
+    
+    LayoutTests:
+    
+    * webanimations/opacity-animation-expected.html: Added.
+    * webanimations/opacity-animation.html: Added.
+    
+    git-svn-id: https://svn.webkit.org/repository/webkit/trunk@255504 268f45cc-cd09-0410-ab3c-d52691b4dbfc
+
+    2020-01-31  Antoine Quint  <[email protected]>
+
+            [Web Animations] [WK1] REGRESSION: opacity doesn't animate
+            https://bugs.webkit.org/show_bug.cgi?id=207044
+            <rdar://problem/59061225>
+
+            Reviewed by Simon Fraser.
+
+            Test: webanimations/opacity-animation.html
+
+            We failed to animate opacity in WK1 because we made the assumption that just because an animation targets only accelerated properties it would be accelerated
+            and wouldn't need to be updated as it runs in WebAnimation::timeToNextTick(). This is incorrect, an animation may fail to start or may fail to get a composited
+            layer, the latter being the case on WK1 because usesCompositing() is false in RenderLayerCompositor::requiresCompositingForAnimation().
+
+            We now check that an animation is both only animating accelerated properties and running accelerated to determine that an animation won't need to be updated
+            until it completes.
+
+            * animation/WebAnimation.cpp:
+            (WebCore::WebAnimation::timeToNextTick const):
+
+2020-02-03  Alan Coon  <[email protected]>
+
         Cherry-pick r255490. rdar://problem/58570085
 
     Regression(r255359): imported/mozilla/svg/svg-integration/clipPath-html-06.xhtml is failing consistently on windows

Modified: branches/safari-610.1.1-branch/Source/WebCore/animation/WebAnimation.cpp (255656 => 255657)


--- branches/safari-610.1.1-branch/Source/WebCore/animation/WebAnimation.cpp	2020-02-04 03:10:22 UTC (rev 255656)
+++ branches/safari-610.1.1-branch/Source/WebCore/animation/WebAnimation.cpp	2020-02-04 03:10:25 UTC (rev 255657)
@@ -1436,16 +1436,17 @@
         // The animation is in its "before" phase, in this case we can wait until it enters its "active" phase.
         return (effect.delay() - timing.localTime.value()) / playbackRate;
     case AnimationEffectPhase::Active:
-        // Non-accelerated animations in the "active" phase will need to update their animated value at the immediate next opportunity.
-        if (!isCompletelyAccelerated())
-            return 0_s;
-        // Accelerated CSS Animations need to trigger "animationiteration" events, in this case we can wait until the next iteration.
-        if (isCSSAnimation()) {
-            if (auto iterationProgress = effect.getComputedTiming().simpleIterationProgress)
-                return effect.iterationDuration() * (1 - *iterationProgress);
+        if (isCompletelyAccelerated() && isRunningAccelerated()) {
+            // Fully-accelerated running CSS Animations need to trigger "animationiteration" events, in this case we must wait until the next iteration.
+            if (isCSSAnimation()) {
+                if (auto iterationProgress = effect.getComputedTiming().simpleIterationProgress)
+                    return effect.iterationDuration() * (1 - *iterationProgress);
+            }
+            // Fully-accelerated running animations in the "active" phase can wait until they ended.
+            return (effect.endTime() - timing.localTime.value()) / playbackRate;
         }
-        // Accelerated animations in the "active" phase can wait until they ended.
-        return (effect.endTime() - timing.localTime.value()) / playbackRate;
+        // Other animations in the "active" phase will need to update their animated value at the immediate next opportunity.
+        return 0_s;
     case AnimationEffectPhase::After:
         // The animation is in its after phase, which means it will no longer update its value, so it doens't need a tick.
         return Seconds::infinity();
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to