<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>[287548] trunk</title>
</head>
<body>

<style type="text/css"><!--
#msg dl.meta { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dl.meta dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer, #logmsg { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt;  }
#msg dl a { font-weight: bold}
#msg dl a:link    { color:#fc3; }
#msg dl a:active  { color:#ff0; }
#msg dl a:visited { color:#cc6; }
h3 { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; font-weight: bold; }
#msg pre { overflow: auto; background: #ffc; border: 1px #fa0 solid; padding: 6px; }
#logmsg { background: #ffc; border: 1px #fa0 solid; padding: 1em 1em 0 1em; }
#logmsg p, #logmsg pre, #logmsg blockquote { margin: 0 0 1em 0; }
#logmsg p, #logmsg li, #logmsg dt, #logmsg dd { line-height: 14pt; }
#logmsg h1, #logmsg h2, #logmsg h3, #logmsg h4, #logmsg h5, #logmsg h6 { margin: .5em 0; }
#logmsg h1:first-child, #logmsg h2:first-child, #logmsg h3:first-child, #logmsg h4:first-child, #logmsg h5:first-child, #logmsg h6:first-child { margin-top: 0; }
#logmsg ul, #logmsg ol { padding: 0; list-style-position: inside; margin: 0 0 0 1em; }
#logmsg ul { text-indent: -1em; padding-left: 1em; }#logmsg ol { text-indent: -1.5em; padding-left: 1.5em; }
#logmsg > ul, #logmsg > ol { margin: 0 0 1em 0; }
#logmsg pre { background: #eee; padding: 1em; }
#logmsg blockquote { border: 1px solid #fa0; border-left-width: 10px; padding: 1em 1em 0 1em; background: white;}
#logmsg dl { margin: 0; }
#logmsg dt { font-weight: bold; }
#logmsg dd { margin: 0; padding: 0 0 0.5em 0; }
#logmsg dd:before { content:'\00bb';}
#logmsg table { border-spacing: 0px; border-collapse: collapse; border-top: 4px solid #fa0; border-bottom: 1px solid #fa0; background: #fff; }
#logmsg table th { text-align: left; font-weight: normal; padding: 0.2em 0.5em; border-top: 1px dotted #fa0; }
#logmsg table td { text-align: right; border-top: 1px dotted #fa0; padding: 0.2em 0.5em; }
#logmsg table thead th { text-align: center; border-bottom: 1px solid #fa0; }
#logmsg table th.Corner { text-align: left; }
#logmsg hr { border: none 0; border-top: 2px dashed #fa0; height: 1px; }
#header, #footer { color: #fff; background: #636; border: 1px #300 solid; padding: 6px; }
#patch { width: 100%; }
#patch h4 {font-family: verdana,arial,helvetica,sans-serif;font-size:10pt;padding:8px;background:#369;color:#fff;margin:0;}
#patch .propset h4, #patch .binary h4 {margin:0;}
#patch pre {padding:0;line-height:1.2em;margin:0;}
#patch .diff {width:100%;background:#eee;padding: 0 0 10px 0;overflow:auto;}
#patch .propset .diff, #patch .binary .diff  {padding:10px 0;}
#patch span {display:block;padding:0 10px;}
#patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, #patch .copfile {border:1px solid #ccc;margin:10px 0;}
#patch ins {background:#dfd;text-decoration:none;display:block;padding:0 10px;}
#patch del {background:#fdd;text-decoration:none;display:block;padding:0 10px;}
#patch .lines, .info {color:#888;background:#fff;}
--></style>
<div id="msg">
<dl class="meta">
<dt>Revision</dt> <dd><a href="http://trac.webkit.org/projects/webkit/changeset/287548">287548</a></dd>
<dt>Author</dt> <dd>graouts@webkit.org</dd>
<dt>Date</dt> <dd>2022-01-03 10:40:00 -0800 (Mon, 03 Jan 2022)</dd>
</dl>

<h3>Log Message</h3>
<pre>[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):</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkLayoutTestsimportedw3cChangeLog">trunk/LayoutTests/imported/w3c/ChangeLog</a></li>
<li><a href="#trunkLayoutTestsimportedw3cwebplatformtestscsscsstransitionsCSSTransitioncurrentTimetentativeexpectedtxt">trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-transitions/CSSTransition-currentTime.tentative-expected.txt</a></li>
<li><a href="#trunkLayoutTestsimportedw3cwebplatformtestscsscsstransitionsCSSTransitioneffecttentativeexpectedtxt">trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-transitions/CSSTransition-effect.tentative-expected.txt</a></li>
<li><a href="#trunkLayoutTestsimportedw3cwebplatformtestscsscsstransitionsKeyframeEffectsetKeyframestentativeexpectedtxt">trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-transitions/KeyframeEffect-setKeyframes.tentative-expected.txt</a></li>
<li><a href="#trunkSourceWebCoreChangeLog">trunk/Source/WebCore/ChangeLog</a></li>
<li><a href="#trunkSourceWebCorestyleStyleablecpp">trunk/Source/WebCore/style/Styleable.cpp</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkLayoutTestsimportedw3cChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/imported/w3c/ChangeLog (287547 => 287548)</h4>
<pre class="diff"><span>
<span class="info">--- 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)
</span><span class="lines">@@ -1,5 +1,18 @@
</span><span class="cx"> 2022-01-03  Antoine Quint  <graouts@webkit.org>
</span><span class="cx"> 
</span><ins>+        [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  <graouts@webkit.org>
+
</ins><span class="cx">         Support the "animation" shorthand property in the computed style
</span><span class="cx">         https://bugs.webkit.org/show_bug.cgi?id=234785
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkLayoutTestsimportedw3cwebplatformtestscsscsstransitionsCSSTransitioncurrentTimetentativeexpectedtxt"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-transitions/CSSTransition-currentTime.tentative-expected.txt (287547 => 287548)</h4>
<pre class="diff"><span>
<span class="info">--- 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)
</span><span class="lines">@@ -3,5 +3,5 @@
</span><span class="cx"> PASS Skipping forwards through transition
</span><span class="cx"> PASS Skipping backwards through transition
</span><span class="cx"> PASS Setting currentTime to null on a CSS transition throws
</span><del>-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
</del><ins>+PASS Transition reversing behavior respects currentTime and uses the transition's current position.
</ins><span class="cx"> 
</span></span></pre></div>
<a id="trunkLayoutTestsimportedw3cwebplatformtestscsscsstransitionsCSSTransitioneffecttentativeexpectedtxt"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-transitions/CSSTransition-effect.tentative-expected.txt (287547 => 287548)</h4>
<pre class="diff"><span>
<span class="info">--- 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)
</span><span class="lines">@@ -8,5 +8,5 @@
</span><span class="cx"> PASS After setting a new keyframe effect targeting different properties, the transition continues to report the original transition property
</span><span class="cx"> PASS After setting a new keyframe effect on a play-pending transition, the transition remains pending
</span><span class="cx"> PASS A transition with no effect still returns the original transitionProperty
</span><del>-FAIL A transition with a replaced effect still exhibits the regular transition reversing behavior assert_approx_equals: expected 80240.33876954127 +/- 1 but got 100000
</del><ins>+PASS A transition with a replaced effect still exhibits the regular transition reversing behavior
</ins><span class="cx"> 
</span></span></pre></div>
<a id="trunkLayoutTestsimportedw3cwebplatformtestscsscsstransitionsKeyframeEffectsetKeyframestentativeexpectedtxt"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-transitions/KeyframeEffect-setKeyframes.tentative-expected.txt (287547 => 287548)</h4>
<pre class="diff"><span>
<span class="info">--- 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)
</span><span class="lines">@@ -2,7 +2,7 @@
</span><span class="cx"> FAIL Keyframes set using setKeyframes() are reflected in computed style for a running transition assert_equals: expected "200px" but got "0px"
</span><span class="cx"> PASS A transition with replaced keyframes still returns the original transitionProperty
</span><span class="cx"> PASS A transition with no keyframes still returns the original transitionProperty
</span><del>-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
</del><ins>+PASS A transition with replaced keyframes animating the same property still exhibits normal reversing behavior.
</ins><span class="cx"> 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')
</span><span class="cx"> 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')
</span><span class="cx"> 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
</span></span></pre></div>
<a id="trunkSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/ChangeLog (287547 => 287548)</h4>
<pre class="diff"><span>
<span class="info">--- 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)
</span><span class="lines">@@ -1,3 +1,16 @@
</span><ins>+2022-01-03  Antoine Quint  <graouts@webkit.org>
+
+        [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):
+
</ins><span class="cx"> 2022-01-03  Wenson Hsieh  <wenson_hsieh@apple.com>
</span><span class="cx"> 
</span><span class="cx">         Undownloaded iCloud Photos are inserted as broken images when attachment element is enabled
</span></span></pre></div>
<a id="trunkSourceWebCorestyleStyleablecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/style/Styleable.cpp (287547 => 287548)</h4>
<pre class="diff"><span>
<span class="info">--- 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)
</span><span class="lines">@@ -479,9 +479,7 @@
</span><span class="cx">         } else if (CSSPropertyAnimation::propertiesEqual(property, previouslyRunningTransition->reversingAdjustedStartStyle(), afterChangeStyle)) {
</span><span class="cx">             // 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
</span><span class="cx">             //    style (see the section on reversing of transitions for why these case exists), implementations must cancel the running transition
</span><del>-            previouslyRunningTransition->cancelFromStyle();
-
-            // and start a new transition whose:
</del><ins>+            //    and start a new transition whose:
</ins><span class="cx">             //   - reversing-adjusted start value is the end value of the running transition,
</span><span class="cx">             //   - reversing shortening factor is the absolute value, clamped to the range [0, 1], of the sum of:
</span><span class="cx">             //       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
</span><span class="lines">@@ -502,12 +500,10 @@
</span><span class="cx">             auto delay = matchingBackingAnimation->delay() < 0 ? Seconds(matchingBackingAnimation->delay()) * reversingShorteningFactor : Seconds(matchingBackingAnimation->delay());
</span><span class="cx">             auto duration = Seconds(matchingBackingAnimation->duration()) * reversingShorteningFactor;
</span><span class="cx"> 
</span><ins>+            previouslyRunningTransition->cancelFromStyle();
</ins><span class="cx">             styleable.ensureRunningTransitionsByProperty().set(property, CSSTransition::create(styleable, property, generationTime, *matchingBackingAnimation, &previouslyRunningTransitionCurrentStyle, afterChangeStyle, delay, duration, reversingAdjustedStartStyle, reversingShorteningFactor));
</span><span class="cx">         } else {
</span><del>-            // 4. Otherwise, implementations must cancel the running transition
-            previouslyRunningTransition->cancelFromStyle();
-
-            // and start a new transition whose:
</del><ins>+            // 4. Otherwise, implementations must cancel the running transition and start a new transition whose:
</ins><span class="cx">             //   - start time is the time of the style change event plus the matching transition delay,
</span><span class="cx">             //   - end time is the start time plus the matching transition duration,
</span><span class="cx">             //   - start value is the current value of the property in the running transition,
</span><span class="lines">@@ -518,6 +514,7 @@
</span><span class="cx">             auto duration = Seconds(matchingBackingAnimation->duration());
</span><span class="cx">             auto& reversingAdjustedStartStyle = currentStyle;
</span><span class="cx">             auto reversingShorteningFactor = 1;
</span><ins>+            previouslyRunningTransition->cancelFromStyle();
</ins><span class="cx">             styleable.ensureRunningTransitionsByProperty().set(property, CSSTransition::create(styleable, property, generationTime, *matchingBackingAnimation, &previouslyRunningTransitionCurrentStyle, afterChangeStyle, delay, duration, reversingAdjustedStartStyle, reversingShorteningFactor));
</span><span class="cx">         }
</span><span class="cx">     }
</span></span></pre>
</div>
</div>

</body>
</html>