Changeset 289161 in webkit


Ignore:
Timestamp:
Feb 5, 2022 1:25:27 PM (5 months ago)
Author:
graouts@webkit.org
Message:

[CSS transition] can't use CSS logical properties in transition syntax
https://bugs.webkit.org/show_bug.cgi?id=232361
<rdar://problem/84958347>

Reviewed by Dean Jackson.

LayoutTests/imported/w3c:

Mark some WPT progressions. The new FAIL result isn't a real regression, that test
simply passed by virtue of not ever starting a transition for a logical property.

  • web-platform-tests/css/css-logical/animation-004-expected.txt:

Source/WebCore:

Resolve logical properties when considering properties that should trigger a transition.
To do so, we must pass the newly-set style to some methods such that they may be able to
reolve logical properties as well.

  • style/Styleable.cpp:

(WebCore::keyframeEffectForElementAndProperty):
(WebCore::transitionMatchesProperty):
(WebCore::updateCSSTransitionsForStyleableAndProperty):

Location:
trunk
Files:
4 edited

Legend:

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

    r289141 r289161  
     12022-02-05  Antoine Quint  <graouts@webkit.org>
     2
     3        [CSS transition] can't use CSS logical properties in transition syntax
     4        https://bugs.webkit.org/show_bug.cgi?id=232361
     5        <rdar://problem/84958347>
     6
     7        Reviewed by Dean Jackson.
     8
     9        Mark some WPT progressions. The new FAIL result isn't a real regression, that test
     10        simply passed by virtue of not ever starting a transition for a logical property.
     11
     12        * web-platform-tests/css/css-logical/animation-004-expected.txt:
     13
    1142022-02-04  Chris Dumez  <cdumez@apple.com>
    215
  • trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-logical/animation-004-expected.txt

    r267650 r289161  
    11
    2 Harness Error (TIMEOUT), message = null
    3 
    4 FAIL Logical properties can be transitioned assert_equals: expected "50px" but got "100px"
    5 FAIL Logical properties in transitions respect the writing-mode assert_equals: expected "50px" but got "100px"
    6 FAIL Logical properties in transitions respect the direction assert_equals: expected "50px" but got "100px"
     2PASS Logical properties can be transitioned
     3PASS Logical properties in transitions respect the writing-mode
     4PASS Logical properties in transitions respect the direction
    75PASS Declaration order is respected within declaration blocks
    86PASS Logical properties are able to override physical properties in declaration blocks
     
    108PASS Physical properties and logical properties can be mixed
    119PASS Declaration order is respected on each keyframe individually
    12 FAIL Transitions update when the writing-mode is changed assert_equals: expected "50px" but got "100px"
    13 TIMEOUT Filling transitions update when the writing-mode is changed Test timed out
    14 FAIL The number of interpolating properties can be increased when the writing-mode is changed assert_equals: expected "50px" but got "100px"
    15 FAIL The number of interpolating properties can be decreased when the writing-mode is changed assert_equals: expected "150px" but got "200px"
    16 FAIL Transitions update when the writing-mode is changed through a CSS variable assert_equals: expected "50px" but got "100px"
    17 FAIL Transitions update when the direction is changed assert_equals: expected "50px" but got "100px"
    18 PASS Transitions from logical to physical update when the direction is changed
    19 FAIL Transitions from physical to logical update when the direction is changed assert_equals: expected "150px" but got "100px"
     10FAIL Transitions update when the writing-mode is changed assert_equals: expected "0px" but got "50px"
     11PASS Filling transitions update when the writing-mode is changed
     12FAIL The number of interpolating properties can be increased when the writing-mode is changed assert_equals: expected "0px" but got "50px"
     13FAIL The number of interpolating properties can be decreased when the writing-mode is changed assert_equals: expected "300px" but got "275px"
     14FAIL Transitions update when the writing-mode is changed through a CSS variable assert_equals: expected "50px" but got "0px"
     15FAIL Transitions update when the direction is changed assert_equals: expected "0px" but got "50px"
     16FAIL Transitions from logical to physical update when the direction is changed assert_equals: expected "0px" but got "50px"
     17FAIL Transitions from physical to logical update when the direction is changed assert_equals: expected "0px" but got "50px"
    2018
  • trunk/Source/WebCore/ChangeLog

    r289158 r289161  
     12022-02-05  Antoine Quint  <graouts@webkit.org>
     2
     3        [CSS transition] can't use CSS logical properties in transition syntax
     4        https://bugs.webkit.org/show_bug.cgi?id=232361
     5        <rdar://problem/84958347>
     6
     7        Reviewed by Dean Jackson.
     8
     9        Resolve logical properties when considering properties that should trigger a transition.
     10        To do so, we must pass the newly-set style to some methods such that they may be able to
     11        reolve logical properties as well.
     12
     13        * style/Styleable.cpp:
     14        (WebCore::keyframeEffectForElementAndProperty):
     15        (WebCore::transitionMatchesProperty):
     16        (WebCore::updateCSSTransitionsForStyleableAndProperty):
     17
    1182022-02-05  Antoine Quint  <graouts@webkit.org>
    219
  • trunk/Source/WebCore/style/Styleable.cpp

    r289156 r289161  
    322322}
    323323
    324 static KeyframeEffect* keyframeEffectForElementAndProperty(const Styleable& styleable, CSSPropertyID property)
     324static KeyframeEffect* keyframeEffectForElementAndProperty(const Styleable& styleable, CSSPropertyID resolvedProperty, CSSPropertyID unresolvedProperty)
    325325{
    326326    if (auto* keyframeEffectStack = styleable.keyframeEffectStack()) {
    327327        auto effects = keyframeEffectStack->sortedEffects();
    328328        for (const auto& effect : makeReversedRange(effects)) {
    329             if (effect->animatesProperty(property))
     329            if (effect->animatesProperty(resolvedProperty) || (resolvedProperty != unresolvedProperty && effect->animatesProperty(unresolvedProperty)))
    330330                return effect.get();
    331331        }
     
    349349}
    350350
    351 static bool transitionMatchesProperty(const Animation& transition, CSSPropertyID property)
     351static bool transitionMatchesProperty(const Animation& transition, CSSPropertyID property, const RenderStyle& style)
    352352{
    353353    if (transition.isPropertyFilled())
     
    358358        return false;
    359359    if (mode == Animation::TransitionMode::SingleProperty) {
    360         auto transitionProperty = transition.property().id;
     360        auto transitionProperty = CSSProperty::resolveDirectionAwareProperty(transition.property().id, style.direction(), style.writingMode());
    361361        if (transitionProperty != property) {
    362362            for (auto longhand : shorthandForProperty(transitionProperty)) {
     
    397397static void updateCSSTransitionsForStyleableAndProperty(const Styleable& styleable, CSSPropertyID property, const RenderStyle& currentStyle, const RenderStyle& newStyle, const MonotonicTime generationTime)
    398398{
    399     auto* keyframeEffect = keyframeEffectForElementAndProperty(styleable, property);
     399    auto unresolvedProperty = property;
     400    property = CSSProperty::resolveDirectionAwareProperty(property, newStyle.direction(), newStyle.writingMode());
     401
     402    auto* keyframeEffect = keyframeEffectForElementAndProperty(styleable, property, unresolvedProperty);
    400403    auto* animation = keyframeEffect ? keyframeEffect->animation() : nullptr;
    401404
     
    412415    if (auto* transitions = newStyle.transitions()) {
    413416        for (auto& backingAnimation : *transitions) {
    414             if (transitionMatchesProperty(backingAnimation.get(), property))
     417            if (transitionMatchesProperty(backingAnimation.get(), property, newStyle))
    415418                matchingBackingAnimation = backingAnimation.ptr();
    416419        }
Note: See TracChangeset for help on using the changeset viewer.