Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-animations/KeyframeEffect-getKeyframes.tentative-expected.txt (251648 => 251649)
--- trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-animations/KeyframeEffect-getKeyframes.tentative-expected.txt 2019-10-28 07:54:53 UTC (rev 251648)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-animations/KeyframeEffect-getKeyframes.tentative-expected.txt 2019-10-28 08:08:59 UTC (rev 251649)
@@ -2,8 +2,8 @@
FAIL KeyframeEffect.getKeyframes() returns no frames for various kinds of empty enimations assert_equals: number of frames when @keyframes has empty keyframes expected 0 but got 2
PASS KeyframeEffect.getKeyframes() returns expected frames for a simple animation
PASS KeyframeEffect.getKeyframes() returns frames with expected easing values, when the easing comes from animation-timing-function on the element
-FAIL KeyframeEffect.getKeyframes() returns frames with expected easing values, when the easing is specified on each keyframe assert_equals: value of 'easing' on ComputedKeyframe #1 expected "ease-in-out" but got "linear"
-FAIL KeyframeEffect.getKeyframes() returns frames with expected easing values, when the easing is specified on some keyframes assert_equals: value of 'easing' on ComputedKeyframe #1 expected "steps(1, start)" but got "linear"
+PASS KeyframeEffect.getKeyframes() returns frames with expected easing values, when the easing is specified on each keyframe
+PASS KeyframeEffect.getKeyframes() returns frames with expected easing values, when the easing is specified on some keyframes
PASS KeyframeEffect.getKeyframes() returns expected frames for a simple animation that specifies a single shorthand property
FAIL KeyframeEffect.getKeyframes() returns expected frames for an animation with a 0% keyframe and no 100% keyframe assert_equals: properties on ComputedKeyframe #1 expected "color,composite,computedOffset,easing,offset" but got "composite,computedOffset,easing,offset"
FAIL KeyframeEffect.getKeyframes() returns expected frames for an animation with a 100% keyframe and no 0% keyframe assert_equals: properties on ComputedKeyframe #0 expected "color,composite,computedOffset,easing,offset" but got "composite,computedOffset,easing,offset"
@@ -10,10 +10,10 @@
FAIL KeyframeEffect.getKeyframes() returns expected frames for an animation with no 0% or 100% keyframe but with a 50% keyframe assert_equals: properties on ComputedKeyframe #0 expected "color,composite,computedOffset,easing,offset" but got "composite,computedOffset,easing,offset"
FAIL KeyframeEffect.getKeyframes() returns expected frames for an animation with a partially complete 100% keyframe (because the !important rule is ignored) assert_equals: properties on ComputedKeyframe #1 expected "composite,computedOffset,easing,marginBottom,marginTop,offset" but got "composite,computedOffset,easing,marginBottom,offset"
PASS KeyframeEffect.getKeyframes() returns expected frames for an animation with different properties on different keyframes, all with the same easing function
-FAIL KeyframeEffect.getKeyframes() returns expected frames for an animation with different properties on different keyframes, with a different easing function on each assert_equals: value for 'easing' on ComputedKeyframe #1 expected "steps(1)" but got "linear"
+PASS KeyframeEffect.getKeyframes() returns expected frames for an animation with different properties on different keyframes, with a different easing function on each
PASS KeyframeEffect.getKeyframes() returns expected frames for an animation with multiple keyframes for the same time, and all with the same easing function
FAIL KeyframeEffect.getKeyframes() returns expected frames for an animation with multiple keyframes for the same time and with different easing functions assert_equals: number of frames expected 3 but got 2
-FAIL KeyframeEffect.getKeyframes() returns expected frames for an animation with multiple keyframes for the same time and with different but equivalent easing functions assert_equals: value for 'easing' on ComputedKeyframe #2 expected "ease" but got "steps(1)"
+PASS KeyframeEffect.getKeyframes() returns expected frames for an animation with multiple keyframes for the same time and with different but equivalent easing functions
PASS KeyframeEffect.getKeyframes() returns expected frames for overlapping keyframes
FAIL KeyframeEffect.getKeyframes() returns expected values for animations with filter properties and missing keyframes assert_equals: properties on ComputedKeyframe #0 expected "composite,computedOffset,easing,filter,offset" but got "composite,computedOffset,easing,offset"
PASS KeyframeEffect.getKeyframes() returns expected values for animation with drop-shadow of filter property
Modified: trunk/Source/WebCore/ChangeLog (251648 => 251649)
--- trunk/Source/WebCore/ChangeLog 2019-10-28 07:54:53 UTC (rev 251648)
+++ trunk/Source/WebCore/ChangeLog 2019-10-28 08:08:59 UTC (rev 251649)
@@ -1,3 +1,18 @@
+2019-10-27 Antoine Quint <[email protected]>
+
+ [Web Animations] getKeyframes() doesn't return the right timing function for declarative animations
+ https://bugs.webkit.org/show_bug.cgi?id=203475
+
+ Reviewed by Dean Jackson.
+
+ We had two bugs for declarative animations and the "easing" property for keyframes returned by KeyframeEffect::getKeyframes().
+ First, we should return "linear" for all keyframes for CSS Transitions since the transition-timing-function is set as the "easing"
+ property of the effect itself, not any indvidual keyframe. Then, we would always return the "easing" of the first keyframe while
+ iterating over keyframes, which was an oversight.
+
+ * animation/KeyframeEffect.cpp:
+ (WebCore::KeyframeEffect::getKeyframes):
+
2019-10-27 Simon Fraser <[email protected]>
Fix nth-child An+B serialization to match the spec
Modified: trunk/Source/WebCore/animation/KeyframeEffect.cpp (251648 => 251649)
--- trunk/Source/WebCore/animation/KeyframeEffect.cpp 2019-10-28 07:54:53 UTC (rev 251648)
+++ trunk/Source/WebCore/animation/KeyframeEffect.cpp 2019-10-28 08:08:59 UTC (rev 251649)
@@ -587,9 +587,8 @@
BaseComputedKeyframe computedKeyframe;
computedKeyframe.offset = keyframe.key();
computedKeyframe.computedOffset = keyframe.key();
- // For CSS transitions, there are only two keyframes and the second keyframe should always report "linear". In practice, this value
- // has no bearing since, as the last keyframe, its value will never be used.
- computedKeyframe.easing = is<CSSTransition>(animation()) && i == 1 ? "linear" : timingFunctionForKeyframeAtIndex(0)->cssText();
+ // For CSS transitions, all keyframes should return "linear" since the effect's global timing function applies.
+ computedKeyframe.easing = is<CSSTransition>(animation()) ? "linear" : timingFunctionForKeyframeAtIndex(i)->cssText();
auto outputKeyframe = convertDictionaryToJS(lexicalGlobalObject, *jsCast<JSDOMGlobalObject*>(&lexicalGlobalObject), computedKeyframe);