Changeset 251649 in webkit


Ignore:
Timestamp:
Oct 28, 2019 1:08:59 AM (4 years ago)
Author:
graouts@webkit.org
Message:

[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.

LayoutTests/imported/w3c:

Mark WPT progressions.

  • web-platform-tests/css/css-animations/KeyframeEffect-getKeyframes.tentative-expected.txt:
  • web-platform-tests/css/css-transitions/KeyframeEffect-getKeyframes.tentative-expected.txt:

Source/WebCore:

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):

Location:
trunk
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/imported/w3c/ChangeLog

    r251647 r251649  
     12019-10-27  Antoine Quint  <graouts@apple.com>
     2
     3        [Web Animations] getKeyframes() doesn't return the right timing function for declarative animations
     4        https://bugs.webkit.org/show_bug.cgi?id=203475
     5
     6        Reviewed by Dean Jackson.
     7
     8        Mark WPT progressions.
     9
     10        * web-platform-tests/css/css-animations/KeyframeEffect-getKeyframes.tentative-expected.txt:
     11        * web-platform-tests/css/css-transitions/KeyframeEffect-getKeyframes.tentative-expected.txt:
     12
    1132019-10-27  Simon Fraser  <simon.fraser@apple.com>
    214
  • trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-animations/KeyframeEffect-getKeyframes.tentative-expected.txt

    r251591 r251649  
    33PASS KeyframeEffect.getKeyframes() returns expected frames for a simple animation
    44PASS KeyframeEffect.getKeyframes() returns frames with expected easing values, when the easing comes from animation-timing-function on the element
    5 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"
    6 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"
     5PASS KeyframeEffect.getKeyframes() returns frames with expected easing values, when the easing is specified on each keyframe
     6PASS KeyframeEffect.getKeyframes() returns frames with expected easing values, when the easing is specified on some keyframes
    77PASS KeyframeEffect.getKeyframes() returns expected frames for a simple animation that specifies a single shorthand property
    88FAIL 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"
     
    1111FAIL 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"
    1212PASS KeyframeEffect.getKeyframes() returns expected frames for an animation with different properties on different keyframes, all with the same easing function
    13 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"
     13PASS KeyframeEffect.getKeyframes() returns expected frames for an animation with different properties on different keyframes, with a different easing function on each
    1414PASS KeyframeEffect.getKeyframes() returns expected frames for an animation with multiple keyframes for the same time, and all with the same easing function
    1515FAIL 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
    16 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)"
     16PASS KeyframeEffect.getKeyframes() returns expected frames for an animation with multiple keyframes for the same time and with different but equivalent easing functions
    1717PASS KeyframeEffect.getKeyframes() returns expected frames for overlapping keyframes
    1818FAIL 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"
  • trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-transitions/KeyframeEffect-getKeyframes.tentative-expected.txt

    r251591 r251649  
    11
    2 FAIL KeyframeEffect.getKeyframes() returns expected frames for a simple transition assert_equals: value for 'easing' on ComputedKeyframe #0 expected "linear" but got "ease"
    3 FAIL KeyframeEffect.getKeyframes() returns frames unaffected by a non-default easing function assert_equals: value for 'easing' on ComputedKeyframe #0 expected "linear" but got "steps(2)"
    4 FAIL KeyframeEffect.getKeyframes() returns expected frames for a transition with a CSS variable endpoint assert_equals: value for 'easing' on ComputedKeyframe #0 expected "linear" but got "ease"
     2PASS KeyframeEffect.getKeyframes() returns expected frames for a simple transition
     3PASS KeyframeEffect.getKeyframes() returns frames unaffected by a non-default easing function
     4PASS KeyframeEffect.getKeyframes() returns expected frames for a transition with a CSS variable endpoint
    55
  • trunk/Source/WebCore/ChangeLog

    r251647 r251649  
     12019-10-27  Antoine Quint  <graouts@apple.com>
     2
     3        [Web Animations] getKeyframes() doesn't return the right timing function for declarative animations
     4        https://bugs.webkit.org/show_bug.cgi?id=203475
     5
     6        Reviewed by Dean Jackson.
     7
     8        We had two bugs for declarative animations and the "easing" property for keyframes returned by KeyframeEffect::getKeyframes().
     9        First, we should return "linear" for all keyframes for CSS Transitions since the transition-timing-function is set as the "easing"
     10        property of the effect itself, not any indvidual keyframe. Then, we would always return the "easing" of the first keyframe while
     11        iterating over keyframes, which was an oversight.
     12
     13        * animation/KeyframeEffect.cpp:
     14        (WebCore::KeyframeEffect::getKeyframes):
     15
    1162019-10-27  Simon Fraser  <simon.fraser@apple.com>
    217
  • trunk/Source/WebCore/animation/KeyframeEffect.cpp

    r251425 r251649  
    588588            computedKeyframe.offset = keyframe.key();
    589589            computedKeyframe.computedOffset = keyframe.key();
    590             // For CSS transitions, there are only two keyframes and the second keyframe should always report "linear". In practice, this value
    591             // has no bearing since, as the last keyframe, its value will never be used.
    592             computedKeyframe.easing = is<CSSTransition>(animation()) && i == 1 ? "linear" : timingFunctionForKeyframeAtIndex(0)->cssText();
     590            // For CSS transitions, all keyframes should return "linear" since the effect's global timing function applies.
     591            computedKeyframe.easing = is<CSSTransition>(animation()) ? "linear" : timingFunctionForKeyframeAtIndex(i)->cssText();
    593592
    594593            auto outputKeyframe = convertDictionaryToJS(lexicalGlobalObject, *jsCast<JSDOMGlobalObject*>(&lexicalGlobalObject), computedKeyframe);
Note: See TracChangeset for help on using the changeset viewer.