Title: [191573] releases/WebKitGTK/webkit-2.10
Revision
191573
Author
[email protected]
Date
2015-10-26 01:53:19 -0700 (Mon, 26 Oct 2015)

Log Message

Merge r191502 - REGRESSION (r187121): Multiple-keyframe animations not honouring ' forwards' fill-mode
https://bugs.webkit.org/show_bug.cgi?id=150328

Reviewed by Dean Jackson.

Source/WebCore:

AnimationBase::getElapsedTime() for a finished animation would return 1 (a progress),
rather than a time value as the caller expects. Fix it to return the total duration
if the animation has finished. This fixes the bug.

Change CompositeAnimation::pauseAnimationAtTime() to be more permissive, allowing
testing of filling-forwards animations with the pause API.

Test: animations/fill-forwards-end-state.html

* page/animation/AnimationBase.cpp:
(WebCore::AnimationBase::getElapsedTime):
* page/animation/CompositeAnimation.cpp:
(WebCore::CompositeAnimation::pauseAnimationAtTime):

LayoutTests:

Filling-forwards test with an animation whose duration is greater than one second,
which showed the bug.

* animations/fill-forwards-end-state-expected.txt: Added.
* animations/fill-forwards-end-state.html: Added.

Modified Paths

Added Paths

Diff

Modified: releases/WebKitGTK/webkit-2.10/LayoutTests/ChangeLog (191572 => 191573)


--- releases/WebKitGTK/webkit-2.10/LayoutTests/ChangeLog	2015-10-26 08:47:11 UTC (rev 191572)
+++ releases/WebKitGTK/webkit-2.10/LayoutTests/ChangeLog	2015-10-26 08:53:19 UTC (rev 191573)
@@ -1,3 +1,25 @@
+2015-10-23  Ryan Haddad  <[email protected]>
+
+        Updating test expectation for animations/fill-forwards-end-state.html
+        https://bugs.webkit.org/show_bug.cgi?id=150328#c11
+
+        Reviewed by Alexey Proskuryakov.
+
+        * animations/fill-forwards-end-state-expected.txt:
+
+2015-10-23  Simon Fraser  <[email protected]>
+
+        REGRESSION (r187121): Multiple-keyframe animations not honouring ' forwards' fill-mode
+        https://bugs.webkit.org/show_bug.cgi?id=150328
+
+        Reviewed by Dean Jackson.
+        
+        Filling-forwards test with an animation whose duration is greater than one second,
+        which showed the bug.
+
+        * animations/fill-forwards-end-state-expected.txt: Added.
+        * animations/fill-forwards-end-state.html: Added.
+
 2015-10-23  Hyemi Shin  <[email protected]>
 
         ConvolverNode.buffer must have same sample rate as the AudioContext

Added: releases/WebKitGTK/webkit-2.10/LayoutTests/animations/fill-forwards-end-state-expected.txt (0 => 191573)


--- releases/WebKitGTK/webkit-2.10/LayoutTests/animations/fill-forwards-end-state-expected.txt	                        (rev 0)
+++ releases/WebKitGTK/webkit-2.10/LayoutTests/animations/fill-forwards-end-state-expected.txt	2015-10-26 08:53:19 UTC (rev 191573)
@@ -0,0 +1,4 @@
+Fill-forwards state should be the last keyframe state.
+
+PASS - "left" property for "box1" element at 2.5s saw something close to: 100
+

Added: releases/WebKitGTK/webkit-2.10/LayoutTests/animations/fill-forwards-end-state.html (0 => 191573)


--- releases/WebKitGTK/webkit-2.10/LayoutTests/animations/fill-forwards-end-state.html	                        (rev 0)
+++ releases/WebKitGTK/webkit-2.10/LayoutTests/animations/fill-forwards-end-state.html	2015-10-26 08:53:19 UTC (rev 191573)
@@ -0,0 +1,40 @@
+<!DOCTYPE html>
+<html>
+<head>
+  <title>Test animation with multiple concurrent animations</title>
+  <style type="text/css" media="screen">
+    #box1 {
+      position: relative;
+      left: 10px;
+      top: 10px;
+      height: 100px;
+      width: 100px;
+      background-color: blue;
+      animation-fill-mode: forwards;
+      animation: anim1 2s 0.2s linear;
+    }
+    @keyframes anim1 {
+        from { left: 100px; }
+        40%  { left: 0px; }
+        60%  { left: 250px; }
+        to   { left: 100px; }
+    }
+  </style>
+  <script src="" type="text/_javascript_" charset="utf-8"></script>
+  <script type="text/_javascript_" charset="utf-8">
+
+    const expectedValues = [
+      // [animation-name, time, element-id, property, expected-value, tolerance]
+      ["anim1", 2.5, "box1", "left", 100, 2],
+    ];
+
+    var disablePauseAnimationAPI = false;
+    runAnimationTest(expectedValues, null, null, disablePauseAnimationAPI);
+  </script>
+</head>
+<body>
+<p>Fill-forwards state should be the last keyframe state.</p>
+<div id="box1"></div>
+<div id="result"></div>
+</body>
+</html>

Modified: releases/WebKitGTK/webkit-2.10/Source/WebCore/ChangeLog (191572 => 191573)


--- releases/WebKitGTK/webkit-2.10/Source/WebCore/ChangeLog	2015-10-26 08:47:11 UTC (rev 191572)
+++ releases/WebKitGTK/webkit-2.10/Source/WebCore/ChangeLog	2015-10-26 08:53:19 UTC (rev 191573)
@@ -1,3 +1,24 @@
+2015-10-23  Simon Fraser  <[email protected]>
+
+        REGRESSION (r187121): Multiple-keyframe animations not honouring ' forwards' fill-mode
+        https://bugs.webkit.org/show_bug.cgi?id=150328
+
+        Reviewed by Dean Jackson.
+        
+        AnimationBase::getElapsedTime() for a finished animation would return 1 (a progress),
+        rather than a time value as the caller expects. Fix it to return the total duration
+        if the animation has finished. This fixes the bug.
+        
+        Change CompositeAnimation::pauseAnimationAtTime() to be more permissive, allowing
+        testing of filling-forwards animations with the pause API.
+
+        Test: animations/fill-forwards-end-state.html
+
+        * page/animation/AnimationBase.cpp:
+        (WebCore::AnimationBase::getElapsedTime):
+        * page/animation/CompositeAnimation.cpp:
+        (WebCore::CompositeAnimation::pauseAnimationAtTime):
+
 2015-10-23  Hyemi Shin  <[email protected]>
 
         ConvolverNode.buffer must have same sample-rate as the AudioContext 

Modified: releases/WebKitGTK/webkit-2.10/Source/WebCore/page/animation/AnimationBase.cpp (191572 => 191573)


--- releases/WebKitGTK/webkit-2.10/Source/WebCore/page/animation/AnimationBase.cpp	2015-10-26 08:47:11 UTC (rev 191572)
+++ releases/WebKitGTK/webkit-2.10/Source/WebCore/page/animation/AnimationBase.cpp	2015-10-26 08:53:19 UTC (rev 191573)
@@ -746,7 +746,7 @@
     if (m_startTime <= 0)
         return 0;
     if (postActive() || fillingForwards())
-        return 1;
+        return m_totalDuration;
 
     return beginAnimationUpdateTime() - m_startTime;
 }

Modified: releases/WebKitGTK/webkit-2.10/Source/WebCore/page/animation/CompositeAnimation.cpp (191572 => 191573)


--- releases/WebKitGTK/webkit-2.10/Source/WebCore/page/animation/CompositeAnimation.cpp	2015-10-26 08:47:11 UTC (rev 191572)
+++ releases/WebKitGTK/webkit-2.10/Source/WebCore/page/animation/CompositeAnimation.cpp	2015-10-26 08:53:19 UTC (rev 191573)
@@ -518,13 +518,8 @@
     if (!keyframeAnim || !keyframeAnim->running())
         return false;
 
-    double count = keyframeAnim->m_animation->iterationCount();
-    if ((t >= 0.0) && ((count == Animation::IterationCountInfinite) || (t <= count * keyframeAnim->duration()))) {
-        keyframeAnim->freezeAtTime(t);
-        return true;
-    }
-
-    return false;
+    keyframeAnim->freezeAtTime(t);
+    return true;
 }
 
 bool CompositeAnimation::pauseTransitionAtTime(CSSPropertyID property, double t)
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to