Title: [287548] trunk
Revision
287548
Author
[email protected]
Date
2022-01-03 10:40:00 -0800 (Mon, 03 Jan 2022)

Log Message

[Web Animations] reversing factor should be computed before canceling the previous transition
https://bugs.webkit.org/show_bug.cgi?id=234821

Reviewed by Dean Jackson.

LayoutTests/imported/w3c:

Mark WPT progressions.

* web-platform-tests/css/css-transitions/CSSTransition-currentTime.tentative-expected.txt:
* web-platform-tests/css/css-transitions/CSSTransition-effect.tentative-expected.txt:
* web-platform-tests/css/css-transitions/KeyframeEffect-setKeyframes.tentative-expected.txt:

Source/WebCore:

We would always compute the transition reversing factor to 1.0 since we would cancel the
previously-running transition prior to getting its computed progress.

* style/Styleable.cpp:
(WebCore::updateCSSTransitionsForStyleableAndProperty):

Modified Paths

Diff

Modified: trunk/LayoutTests/imported/w3c/ChangeLog (287547 => 287548)


--- trunk/LayoutTests/imported/w3c/ChangeLog	2022-01-03 18:27:07 UTC (rev 287547)
+++ trunk/LayoutTests/imported/w3c/ChangeLog	2022-01-03 18:40:00 UTC (rev 287548)
@@ -1,5 +1,18 @@
 2022-01-03  Antoine Quint  <[email protected]>
 
+        [Web Animations] reversing factor should be computed before canceling the previous transition
+        https://bugs.webkit.org/show_bug.cgi?id=234821
+
+        Reviewed by Dean Jackson.
+
+        Mark WPT progressions.
+
+        * web-platform-tests/css/css-transitions/CSSTransition-currentTime.tentative-expected.txt:
+        * web-platform-tests/css/css-transitions/CSSTransition-effect.tentative-expected.txt:
+        * web-platform-tests/css/css-transitions/KeyframeEffect-setKeyframes.tentative-expected.txt:
+
+2022-01-03  Antoine Quint  <[email protected]>
+
         Support the "animation" shorthand property in the computed style
         https://bugs.webkit.org/show_bug.cgi?id=234785
 

Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-transitions/CSSTransition-currentTime.tentative-expected.txt (287547 => 287548)


--- trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-transitions/CSSTransition-currentTime.tentative-expected.txt	2022-01-03 18:27:07 UTC (rev 287547)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-transitions/CSSTransition-currentTime.tentative-expected.txt	2022-01-03 18:40:00 UTC (rev 287548)
@@ -3,5 +3,5 @@
 PASS Skipping forwards through transition
 PASS Skipping backwards through transition
 PASS Setting currentTime to null on a CSS transition throws
-FAIL Transition reversing behavior respects currentTime and uses the transition's current position. assert_approx_equals: The reversed transition has correctly reduced duration expected 31535.681250589303 +/- 1 but got 100000
+PASS Transition reversing behavior respects currentTime and uses the transition's current position.
 

Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-transitions/CSSTransition-effect.tentative-expected.txt (287547 => 287548)


--- trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-transitions/CSSTransition-effect.tentative-expected.txt	2022-01-03 18:27:07 UTC (rev 287547)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-transitions/CSSTransition-effect.tentative-expected.txt	2022-01-03 18:40:00 UTC (rev 287548)
@@ -8,5 +8,5 @@
 PASS After setting a new keyframe effect targeting different properties, the transition continues to report the original transition property
 PASS After setting a new keyframe effect on a play-pending transition, the transition remains pending
 PASS A transition with no effect still returns the original transitionProperty
-FAIL A transition with a replaced effect still exhibits the regular transition reversing behavior assert_approx_equals: expected 80240.33876954127 +/- 1 but got 100000
+PASS A transition with a replaced effect still exhibits the regular transition reversing behavior
 

Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-transitions/KeyframeEffect-setKeyframes.tentative-expected.txt (287547 => 287548)


--- trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-transitions/KeyframeEffect-setKeyframes.tentative-expected.txt	2022-01-03 18:27:07 UTC (rev 287547)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-transitions/KeyframeEffect-setKeyframes.tentative-expected.txt	2022-01-03 18:40:00 UTC (rev 287548)
@@ -2,7 +2,7 @@
 FAIL Keyframes set using setKeyframes() are reflected in computed style for a running transition assert_equals: expected "200px" but got "0px"
 PASS A transition with replaced keyframes still returns the original transitionProperty
 PASS A transition with no keyframes still returns the original transitionProperty
-FAIL A transition with replaced keyframes animating the same property still exhibits normal reversing behavior. assert_approx_equals: The reversed transition has correctly reduced duration expected 50000 +/- 1 but got 100000
+PASS A transition with replaced keyframes animating the same property still exhibits normal reversing behavior.
 FAIL A transition with replaced keyframes animating a different property still exhibits normal reversing behavior  (reversing from the base value). undefined is not an object (evaluating 'reversedTransition.effect')
 FAIL A transition with replaced keyframes animating nothing still exhibits normal reversing behavior (reversing from the base value). undefined is not an object (evaluating 'reversedTransition.effect')
 FAIL A transition with replaced keyframes animating nothing on a property being controlled by another modified transition exhibits normal reversing behavior and reverses from the other transition's current value. assert_approx_equals: The reversed transition has correctly reduced duration (based on the original left transition). expected 50000 +/- 1 but got 100000

Modified: trunk/Source/WebCore/ChangeLog (287547 => 287548)


--- trunk/Source/WebCore/ChangeLog	2022-01-03 18:27:07 UTC (rev 287547)
+++ trunk/Source/WebCore/ChangeLog	2022-01-03 18:40:00 UTC (rev 287548)
@@ -1,3 +1,16 @@
+2022-01-03  Antoine Quint  <[email protected]>
+
+        [Web Animations] reversing factor should be computed before canceling the previous transition
+        https://bugs.webkit.org/show_bug.cgi?id=234821
+
+        Reviewed by Dean Jackson.
+
+        We would always compute the transition reversing factor to 1.0 since we would cancel the
+        previously-running transition prior to getting its computed progress.
+
+        * style/Styleable.cpp:
+        (WebCore::updateCSSTransitionsForStyleableAndProperty):
+
 2022-01-03  Wenson Hsieh  <[email protected]>
 
         Undownloaded iCloud Photos are inserted as broken images when attachment element is enabled

Modified: trunk/Source/WebCore/style/Styleable.cpp (287547 => 287548)


--- trunk/Source/WebCore/style/Styleable.cpp	2022-01-03 18:27:07 UTC (rev 287547)
+++ trunk/Source/WebCore/style/Styleable.cpp	2022-01-03 18:40:00 UTC (rev 287548)
@@ -479,9 +479,7 @@
         } else if (CSSPropertyAnimation::propertiesEqual(property, previouslyRunningTransition->reversingAdjustedStartStyle(), afterChangeStyle)) {
             // 3. Otherwise, if the reversing-adjusted start value of the running transition is the same as the value of the property in the after-change
             //    style (see the section on reversing of transitions for why these case exists), implementations must cancel the running transition
-            previouslyRunningTransition->cancelFromStyle();
-
-            // and start a new transition whose:
+            //    and start a new transition whose:
             //   - reversing-adjusted start value is the end value of the running transition,
             //   - reversing shortening factor is the absolute value, clamped to the range [0, 1], of the sum of:
             //       1. the output of the timing function of the old transition at the time of the style change event, times the reversing shortening factor of the old transition
@@ -502,12 +500,10 @@
             auto delay = matchingBackingAnimation->delay() < 0 ? Seconds(matchingBackingAnimation->delay()) * reversingShorteningFactor : Seconds(matchingBackingAnimation->delay());
             auto duration = Seconds(matchingBackingAnimation->duration()) * reversingShorteningFactor;
 
+            previouslyRunningTransition->cancelFromStyle();
             styleable.ensureRunningTransitionsByProperty().set(property, CSSTransition::create(styleable, property, generationTime, *matchingBackingAnimation, &previouslyRunningTransitionCurrentStyle, afterChangeStyle, delay, duration, reversingAdjustedStartStyle, reversingShorteningFactor));
         } else {
-            // 4. Otherwise, implementations must cancel the running transition
-            previouslyRunningTransition->cancelFromStyle();
-
-            // and start a new transition whose:
+            // 4. Otherwise, implementations must cancel the running transition and start a new transition whose:
             //   - start time is the time of the style change event plus the matching transition delay,
             //   - end time is the start time plus the matching transition duration,
             //   - start value is the current value of the property in the running transition,
@@ -518,6 +514,7 @@
             auto duration = Seconds(matchingBackingAnimation->duration());
             auto& reversingAdjustedStartStyle = currentStyle;
             auto reversingShorteningFactor = 1;
+            previouslyRunningTransition->cancelFromStyle();
             styleable.ensureRunningTransitionsByProperty().set(property, CSSTransition::create(styleable, property, generationTime, *matchingBackingAnimation, &previouslyRunningTransitionCurrentStyle, afterChangeStyle, delay, duration, reversingAdjustedStartStyle, reversingShorteningFactor));
         }
     }
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to