Changeset 289216 in webkit


Ignore:
Timestamp:
Feb 7, 2022 7:10:33 AM (5 months ago)
Author:
graouts@webkit.org
Message:

[css-logical] [web-animations] Add support for logical properties in JS-originated animations
https://bugs.webkit.org/show_bug.cgi?id=236229

Reviewed by Dean Jackson.

LayoutTests/imported/w3c:

Mark WPT progressions.

  • web-platform-tests/css/css-logical/animation-001-expected.txt:
  • web-platform-tests/web-animations/interfaces/Animation/commitStyles-expected.txt:
  • web-platform-tests/web-animations/timing-model/timelines/update-and-send-events-replacement-expected.txt:

Source/WebCore:

We need to resolve logical properties when parsing keyframes provided by the Web Animations bindings
and when considering whether an animation can be removed based on properties found on the effect stack.

  • animation/DocumentTimeline.cpp:

(WebCore::DocumentTimeline::animationCanBeRemoved):

  • animation/KeyframeEffect.cpp:

(WebCore::processKeyframeLikeObject):

Location:
trunk
Files:
7 edited

Legend:

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

    r289209 r289216  
     12022-02-07  Antoine Quint  <graouts@webkit.org>
     2
     3        [css-logical] [web-animations] Add support for logical properties in JS-originated animations
     4        https://bugs.webkit.org/show_bug.cgi?id=236229
     5
     6        Reviewed by Dean Jackson.
     7
     8        Mark WPT progressions.
     9
     10        * web-platform-tests/css/css-logical/animation-001-expected.txt:
     11        * web-platform-tests/web-animations/interfaces/Animation/commitStyles-expected.txt:
     12        * web-platform-tests/web-animations/timing-model/timelines/update-and-send-events-replacement-expected.txt:
     13
    1142022-02-07  Ziran Sun  <zsun@igalia.com>
    215
  • trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-logical/animation-001-expected.txt

    r267650 r289216  
    11
    2 FAIL Logical properties can be animated using object notation assert_equals: expected "50px" but got "0px"
    3 FAIL Logical properties can be animated using array notation assert_equals: expected "50px" but got "0px"
    4 FAIL Logical properties are NOT stored as physical properties assert_equals: expected 2 but got 0
    5 FAIL Logical properties in animations respect the writing-mode assert_equals: expected "50px" but got "0px"
    6 FAIL Logical properties in animations respect the direction assert_equals: expected "50px" but got "0px"
     2PASS Logical properties can be animated using object notation
     3PASS Logical properties can be animated using array notation
     4PASS Logical properties are NOT stored as physical properties
     5PASS Logical properties in animations respect the writing-mode
     6PASS Logical properties in animations respect the direction
    77PASS Physical properties win over logical properties in object notation
    88PASS Physical properties win over logical properties in array notation
    99PASS Physical properties with variables win over logical properties
    10 FAIL Logical shorthands follow the usual prioritization based on number of component longhands assert_equals: expected "100px" but got "0px"
     10FAIL Logical shorthands follow the usual prioritization based on number of component longhands assert_equals: expected "200px" but got "0px"
    1111FAIL Physical longhands win over logical shorthands assert_equals: expected "100px" but got "0px"
    12 FAIL Logical longhands win over physical shorthands assert_equals: expected "100px" but got "200px"
     12PASS Logical longhands win over physical shorthands
    1313PASS Physical shorthands win over logical shorthands
    1414PASS Physical shorthands using variables win over logical shorthands
    15 FAIL Physical properties and logical properties can be mixed assert_equals: expected "250px" but got "300px"
     15PASS Physical properties and logical properties can be mixed
    1616FAIL Physical shorthands and logical shorthands can be mixed assert_equals: expected "250px" but got "150px"
    1717PASS Physical properties win over logical properties even when some keyframes only have logical properties
    1818FAIL Animations update when the writing-mode is changed assert_equals: expected "50px" but got "0px"
    1919FAIL Filling animations update when the writing-mode is changed assert_equals: expected "100px" but got "0px"
    20 FAIL Animations with implicit from values update when the writing-mode is changed assert_equals: expected "250px" but got "200px"
     20FAIL Animations with implicit from values update when the writing-mode is changed assert_equals: expected "200px" but got "100px"
    2121FAIL Animations with overlapping physical and logical properties update when the writing-mode is changed assert_equals: expected "50px" but got "0px"
    2222FAIL Animations update when the writing-mode is changed through a CSS variable assert_equals: expected "50px" but got "0px"
    23 FAIL Animations update when the direction is changed assert_equals: expected "50px" but got "0px"
     23FAIL Animations update when the direction is changed assert_equals: expected "0px" but got "50px"
    2424FAIL Logical shorthand with variable references animates correctly assert_equals: expected "250px" but got "auto"
    2525PASS writing-mode is not animatable
  • trunk/LayoutTests/imported/w3c/web-platform-tests/web-animations/interfaces/Animation/commitStyles-expected.txt

    r287917 r289216  
    33PASS Commits styles for an animation that has been removed
    44PASS Commits shorthand styles
    5 FAIL Commits logical properties assert_equals: expected "20px" but got "10px"
    6 FAIL Commits logical properties as physical properties assert_equals: expected "20px" but got "10px"
     5PASS Commits logical properties
     6PASS Commits logical properties as physical properties
    77PASS Commits values calculated mid-interval
    88PASS Commits variable references as their computed values
  • trunk/LayoutTests/imported/w3c/web-platform-tests/web-animations/timing-model/timelines/update-and-send-events-replacement-expected.txt

    r267649 r289216  
    1818PASS Removes an animation when another animation uses a shorthand
    1919PASS Removes an animation that uses a shorthand
    20 FAIL Removes an animation by another animation using logical properties assert_equals: expected "removed" but got "active"
     20PASS Removes an animation by another animation using logical properties
    2121PASS Removes an animation using logical properties
    22 FAIL Removes an animation by another animation using logical properties after updating the context assert_equals: expected "active" but got "removed"
     22FAIL Removes an animation by another animation using logical properties after updating the context assert_equals: expected "removed" but got "active"
    2323PASS Removes an animation after updating another animation's effect's target
    2424PASS Removes an animation after updating its effect's target
  • trunk/Source/WebCore/ChangeLog

    r289215 r289216  
     12022-02-07  Antoine Quint  <graouts@webkit.org>
     2
     3        [css-logical] [web-animations] Add support for logical properties in JS-originated animations
     4        https://bugs.webkit.org/show_bug.cgi?id=236229
     5
     6        Reviewed by Dean Jackson.
     7
     8        We need to resolve logical properties when parsing keyframes provided by the Web Animations bindings
     9        and when considering whether an animation can be removed based on properties found on the effect stack.
     10
     11        * animation/DocumentTimeline.cpp:
     12        (WebCore::DocumentTimeline::animationCanBeRemoved):
     13        * animation/KeyframeEffect.cpp:
     14        (WebCore::processKeyframeLikeObject):
     15
    1162022-02-07  Antoine Quint  <graouts@webkit.org>
    217
  • trunk/Source/WebCore/animation/DocumentTimeline.cpp

    r289212 r289216  
    236236        return false;
    237237
    238     HashSet<CSSPropertyID> propertiesToMatch = keyframeEffect->animatedProperties();
     238    ASSERT(target->renderer());
     239    auto& style = target->renderer()->style();
     240
     241    HashSet<CSSPropertyID> propertiesToMatch;
     242    for (auto cssProperty : keyframeEffect->animatedProperties())
     243        propertiesToMatch.add(CSSProperty::resolveDirectionAwareProperty(cssProperty, style.direction(), style.writingMode()));
    239244
    240245    Vector<RefPtr<WebAnimation>> animations;
     
    254259            if (is<KeyframeEffect>(effectWithHigherCompositeOrder)) {
    255260                auto* keyframeEffectWithHigherCompositeOrder = downcast<KeyframeEffect>(effectWithHigherCompositeOrder);
    256                 for (auto cssPropertyId : keyframeEffectWithHigherCompositeOrder->animatedProperties()) {
    257                     if (propertiesToMatch.remove(cssPropertyId) && propertiesToMatch.isEmpty())
     261                for (auto cssProperty : keyframeEffectWithHigherCompositeOrder->animatedProperties()) {
     262                    auto resolvedProperty = CSSProperty::resolveDirectionAwareProperty(cssProperty, style.direction(), style.writingMode());
     263                    if (propertiesToMatch.remove(resolvedProperty) && propertiesToMatch.isEmpty())
    258264                        break;
    259265                }
  • trunk/Source/WebCore/animation/KeyframeEffect.cpp

    r289211 r289216  
    228228    //    properties, or which are in input properties and conform to the <custom-property-name> production.
    229229    Vector<JSC::Identifier> animationProperties;
    230     size_t numberOfProperties = inputProperties.size();
    231     for (size_t i = 0; i < numberOfProperties; ++i) {
    232         if (CSSPropertyAnimation::isPropertyAnimatable(IDLAttributeNameToAnimationPropertyName(inputProperties[i].string())))
    233             animationProperties.append(inputProperties[i]);
     230    for (auto& inputProperty : inputProperties) {
     231        auto cssProperty = IDLAttributeNameToAnimationPropertyName(inputProperty.string());
     232        auto resolvedCSSProperty = CSSProperty::resolveDirectionAwareProperty(cssProperty, RenderStyle::initialDirection(), RenderStyle::initialWritingMode());
     233        if (CSSPropertyAnimation::isPropertyAnimatable(resolvedCSSProperty))
     234            animationProperties.append(inputProperty);
    234235    }
    235236
Note: See TracChangeset for help on using the changeset viewer.