Changeset 287518 in webkit


Ignore:
Timestamp:
Jan 2, 2022 9:59:08 AM (7 months ago)
Author:
graouts@webkit.org
Message:

[Web Animations] getKeyframes() should ensure that all properties are present on 0% and 100% keyframes
https://bugs.webkit.org/show_bug.cgi?id=234795

Reviewed by Dean Jackson.

LayoutTests/imported/w3c:

Mark a WPT progressions.

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

Source/WebCore:

Keyframes at 0% and 100% may not explicitly specify properties animated on intermediate keyframes, so
in the case of such keyframes, we must ensure we output the non-animated value for properties not
explicitly specified on the keyframe style.

  • animation/KeyframeEffect.cpp:

(WebCore::KeyframeEffect::getKeyframes):

Location:
trunk
Files:
4 edited

Legend:

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

    r287517 r287518  
     12022-01-02  Antoine Quint  <graouts@webkit.org>
     2
     3        [Web Animations] getKeyframes() should ensure that all properties are present on 0% and 100% keyframes
     4        https://bugs.webkit.org/show_bug.cgi?id=234795
     5
     6        Reviewed by Dean Jackson.
     7
     8        Mark a WPT progressions.
     9
     10        * web-platform-tests/css/css-animations/KeyframeEffect-getKeyframes.tentative-expected.txt:
     11
    1122022-01-02  Antoine Quint  <graouts@webkit.org>
    213
  • trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-animations/KeyframeEffect-getKeyframes.tentative-expected.txt

    r287517 r287518  
    66PASS 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
    8 FAIL KeyframeEffect.getKeyframes() returns expected frames for an animation with a 0% keyframe and no 100% keyframe assert_array_equals: properties on Keyframe #1 should match lengths differ, expected array ["color", "composite", "computedOffset", "easing", "offset"] length 5, got ["composite", "computedOffset", "easing", "offset"] length 4
    9 FAIL KeyframeEffect.getKeyframes() returns expected frames for an animation with a 100% keyframe and no 0% keyframe assert_array_equals: properties on Keyframe #0 should match lengths differ, expected array ["color", "composite", "computedOffset", "easing", "offset"] length 5, got ["composite", "computedOffset", "easing", "offset"] length 4
    10 FAIL KeyframeEffect.getKeyframes() returns expected frames for an animation with no 0% or 100% keyframe but with a 50% keyframe assert_array_equals: properties on Keyframe #0 should match lengths differ, expected array ["color", "composite", "computedOffset", "easing", "offset"] length 5, got ["composite", "computedOffset", "easing", "offset"] length 4
    11 FAIL KeyframeEffect.getKeyframes() returns expected frames for an animation with a partially complete 100% keyframe (because the !important rule is ignored) assert_array_equals: properties on Keyframe #1 should match lengths differ, expected array ["composite", "computedOffset", "easing", "marginBottom", "marginTop", "offset"] length 6, got ["composite", "computedOffset", "easing", "marginBottom", "offset"] length 5
     8PASS KeyframeEffect.getKeyframes() returns expected frames for an animation with a 0% keyframe and no 100% keyframe
     9PASS KeyframeEffect.getKeyframes() returns expected frames for an animation with a 100% keyframe and no 0% keyframe
     10PASS KeyframeEffect.getKeyframes() returns expected frames for an animation with no 0% or 100% keyframe but with a 50% keyframe
     11PASS KeyframeEffect.getKeyframes() returns expected frames for an animation with a partially complete 100% keyframe (because the !important rule is ignored)
    1212PASS KeyframeEffect.getKeyframes() returns expected frames for an animation with different properties on different keyframes, all with the same easing function
    1313PASS KeyframeEffect.getKeyframes() returns expected frames for an animation with different properties on different keyframes, with a different easing function on each
     
    1616PASS 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
    18 FAIL KeyframeEffect.getKeyframes() returns expected values for animations with filter properties and missing keyframes assert_array_equals: properties on Keyframe #0 should match lengths differ, expected array ["composite", "computedOffset", "easing", "filter", "offset"] length 5, got ["composite", "computedOffset", "easing", "offset"] length 4
     18FAIL KeyframeEffect.getKeyframes() returns expected values for animations with filter properties and missing keyframes assert_equals: value for 'filter' on Keyframe #1 should match expected "blur(5px) sepia(60%) saturate(30%)" but got "blur(5px) sepia(0.6) saturate(0.3)"
    1919PASS KeyframeEffect.getKeyframes() returns expected values for animation with drop-shadow of filter property
    20 FAIL KeyframeEffect.getKeyframes() returns expected values for animations with text-shadow properties and missing keyframes assert_array_equals: properties on Keyframe #0 should match lengths differ, expected array ["composite", "computedOffset", "easing", "offset", "textShadow"] length 5, got ["composite", "computedOffset", "easing", "offset"] length 4
    21 FAIL KeyframeEffect.getKeyframes() returns expected values for animations with background-size properties and missing keyframes assert_array_equals: properties on ComputedKeyframe #0 should match lengths differ, expected array ["backgroundSize", "composite", "computedOffset", "easing", "offset"] length 5, got ["composite", "computedOffset", "easing", "offset"] length 4
    22 FAIL KeyframeEffect.getKeyframes() returns expected values for animations with CSS variables as keyframe values assert_array_equals: properties on Keyframe #0 should match lengths differ, expected array ["composite", "computedOffset", "easing", "offset", "transform"] length 5, got ["composite", "computedOffset", "easing", "offset"] length 4
    23 FAIL KeyframeEffect.getKeyframes() returns expected values for animations with CSS variables as keyframe values in a shorthand property assert_array_equals: properties on Keyframe #0 should match lengths differ, expected array ["composite", "computedOffset", "easing", "marginBottom", "marginLeft", "marginRight", "marginTop", "offset"] length 8, got ["composite", "computedOffset", "easing", "offset"] length 4
    24 FAIL KeyframeEffect.getKeyframes() returns expected values for animations with a CSS variable which is overriden by the value in keyframe assert_array_equals: properties on Keyframe #0 should match lengths differ, expected array ["color", "composite", "computedOffset", "easing", "offset"] length 5, got ["composite", "computedOffset", "easing", "offset"] length 4
     20FAIL KeyframeEffect.getKeyframes() returns expected values for animations with text-shadow properties and missing keyframes assert_equals: value for 'textShadow' on Keyframe #0 should match expected "rgb(0, 0, 0) 1px 1px 2px, rgb(0, 0, 255) 0px 0px 16px, rgb(0, 0, 255) 0px 0px 3.2px" but got "rgb(0, 0, 0) 1px 1px 2px, rgb(0, 0, 255) 0px 0px 16px, rgb(0, 0, 255) 0px 0px 3.200000047683716px"
     21FAIL KeyframeEffect.getKeyframes() returns expected values for animations with background-size properties and missing keyframes assert_equals: value for 'backgroundSize' on ComputedKeyframe #1 should match expected "50%, 6px, contain" but got "50%"
     22FAIL KeyframeEffect.getKeyframes() returns expected values for animations with CSS variables as keyframe values assert_equals: value for 'transform' on Keyframe #1 should match expected "translate(100px)" but got "matrix(1, 0, 0, 1, 100, 0)"
     23PASS KeyframeEffect.getKeyframes() returns expected values for animations with CSS variables as keyframe values in a shorthand property
     24PASS KeyframeEffect.getKeyframes() returns expected values for animations with a CSS variable which is overriden by the value in keyframe
    2525FAIL KeyframeEffect.getKeyframes() returns expected values for animations with only custom property in a keyframe assert_equals: value for 'transform' on Keyframe #0 should match expected "translate(100px)" but got "matrix(1, 0, 0, 1, 100, 0)"
    2626FAIL KeyframeEffect.getKeyframes() reflects changes to @keyframes rules assert_equals: value for 'left' on Keyframes reflects the updated @keyframes rule should match expected "200px" but got "100px"
  • trunk/Source/WebCore/ChangeLog

    r287517 r287518  
     12022-01-02  Antoine Quint  <graouts@webkit.org>
     2
     3        [Web Animations] getKeyframes() should ensure that all properties are present on 0% and 100% keyframes
     4        https://bugs.webkit.org/show_bug.cgi?id=234795
     5
     6        Reviewed by Dean Jackson.
     7
     8        Keyframes at 0% and 100% may not explicitly specify properties animated on intermediate keyframes, so
     9        in the case of such keyframes, we must ensure we output the non-animated value for properties not
     10        explicitly specified on the keyframe style.
     11
     12        * animation/KeyframeEffect.cpp:
     13        (WebCore::KeyframeEffect::getKeyframes):
     14
    1152022-01-02  Antoine Quint  <graouts@webkit.org>
    216
  • trunk/Source/WebCore/animation/KeyframeEffect.cpp

    r287517 r287518  
    636636        auto* target = m_target.get();
    637637        auto* renderer = this->renderer();
     638        auto* lastStyleChangeEventStyle = targetStyleable()->lastStyleChangeEventStyle();
    638639
    639640        auto computedStyleExtractor = ComputedStyleExtractor(target, false, m_pseudoId);
     
    662663
    663664            // 3. For each animation property-value pair specified on keyframe, declaration, perform the following steps:
     665            auto isFirstOrLastKeyframe = !keyframe.key() || keyframe.key() == 1;
     666            auto& properties = isFirstOrLastKeyframe ? m_blendingKeyframes.properties() : keyframe.properties();
    664667            auto& style = *keyframe.style();
    665             for (auto cssPropertyId : keyframe.properties()) {
     668            for (auto cssPropertyId : properties) {
    666669                if (cssPropertyId == CSSPropertyCustom)
    667670                    continue;
     
    670673                // 2. Let IDL value be the result of serializing the property value of declaration by passing declaration to the algorithm to serialize a CSS value.
    671674                String idlValue = "";
    672                 if (auto cssValue = computedStyleExtractor.valueForPropertyInStyle(style, cssPropertyId, renderer))
     675                if (isFirstOrLastKeyframe && !keyframe.properties().contains(cssPropertyId) && lastStyleChangeEventStyle) {
     676                    if (auto cssValue = computedStyleExtractor.valueForPropertyInStyle(*lastStyleChangeEventStyle, cssPropertyId, renderer))
     677                        idlValue = cssValue->cssText();
     678                } else if (auto cssValue = computedStyleExtractor.valueForPropertyInStyle(style, cssPropertyId, renderer))
    673679                    idlValue = cssValue->cssText();
    674680                // 3. Let value be the result of converting IDL value to an ECMAScript String value.
Note: See TracChangeset for help on using the changeset viewer.