Title: [289161] trunk
Revision
289161
Author
grao...@webkit.org
Date
2022-02-05 13:25:27 -0800 (Sat, 05 Feb 2022)

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

Modified Paths

Diff

Modified: trunk/LayoutTests/imported/w3c/ChangeLog (289160 => 289161)


--- trunk/LayoutTests/imported/w3c/ChangeLog	2022-02-05 19:44:48 UTC (rev 289160)
+++ trunk/LayoutTests/imported/w3c/ChangeLog	2022-02-05 21:25:27 UTC (rev 289161)
@@ -1,3 +1,16 @@
+2022-02-05  Antoine Quint  <grao...@webkit.org>
+
+        [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.
+
+        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:
+
 2022-02-04  Chris Dumez  <cdu...@apple.com>
 
         Unreviewed, land missing baseline for Shared Worker test.

Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-logical/animation-004-expected.txt (289160 => 289161)


--- trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-logical/animation-004-expected.txt	2022-02-05 19:44:48 UTC (rev 289160)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-logical/animation-004-expected.txt	2022-02-05 21:25:27 UTC (rev 289161)
@@ -1,20 +1,18 @@
 
-Harness Error (TIMEOUT), message = null
-
-FAIL Logical properties can be transitioned assert_equals: expected "50px" but got "100px"
-FAIL Logical properties in transitions respect the writing-mode assert_equals: expected "50px" but got "100px"
-FAIL Logical properties in transitions respect the direction assert_equals: expected "50px" but got "100px"
+PASS Logical properties can be transitioned
+PASS Logical properties in transitions respect the writing-mode
+PASS Logical properties in transitions respect the direction
 PASS Declaration order is respected within declaration blocks
 PASS Logical properties are able to override physical properties in declaration blocks
 PASS Declaration order is respected amongst logical properties within declaration blocks
 PASS Physical properties and logical properties can be mixed
 PASS Declaration order is respected on each keyframe individually
-FAIL Transitions update when the writing-mode is changed assert_equals: expected "50px" but got "100px"
-TIMEOUT Filling transitions update when the writing-mode is changed Test timed out
-FAIL The number of interpolating properties can be increased when the writing-mode is changed assert_equals: expected "50px" but got "100px"
-FAIL The number of interpolating properties can be decreased when the writing-mode is changed assert_equals: expected "150px" but got "200px"
-FAIL Transitions update when the writing-mode is changed through a CSS variable assert_equals: expected "50px" but got "100px"
-FAIL Transitions update when the direction is changed assert_equals: expected "50px" but got "100px"
-PASS Transitions from logical to physical update when the direction is changed
-FAIL Transitions from physical to logical update when the direction is changed assert_equals: expected "150px" but got "100px"
+FAIL Transitions update when the writing-mode is changed assert_equals: expected "0px" but got "50px"
+PASS Filling transitions update when the writing-mode is changed
+FAIL The number of interpolating properties can be increased when the writing-mode is changed assert_equals: expected "0px" but got "50px"
+FAIL The number of interpolating properties can be decreased when the writing-mode is changed assert_equals: expected "300px" but got "275px"
+FAIL Transitions update when the writing-mode is changed through a CSS variable assert_equals: expected "50px" but got "0px"
+FAIL Transitions update when the direction is changed assert_equals: expected "0px" but got "50px"
+FAIL Transitions from logical to physical update when the direction is changed assert_equals: expected "0px" but got "50px"
+FAIL Transitions from physical to logical update when the direction is changed assert_equals: expected "0px" but got "50px"
 

Modified: trunk/Source/WebCore/ChangeLog (289160 => 289161)


--- trunk/Source/WebCore/ChangeLog	2022-02-05 19:44:48 UTC (rev 289160)
+++ trunk/Source/WebCore/ChangeLog	2022-02-05 21:25:27 UTC (rev 289161)
@@ -1,5 +1,22 @@
 2022-02-05  Antoine Quint  <grao...@webkit.org>
 
+        [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.
+
+        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):
+
+2022-02-05  Antoine Quint  <grao...@webkit.org>
+
         [Web Animations] Address KeyframeEffect::isAboutToRunAccelerated() FIXME
         https://bugs.webkit.org/show_bug.cgi?id=236178
 

Modified: trunk/Source/WebCore/style/Styleable.cpp (289160 => 289161)


--- trunk/Source/WebCore/style/Styleable.cpp	2022-02-05 19:44:48 UTC (rev 289160)
+++ trunk/Source/WebCore/style/Styleable.cpp	2022-02-05 21:25:27 UTC (rev 289161)
@@ -321,12 +321,12 @@
     element.cssAnimationsDidUpdate(pseudoId);
 }
 
-static KeyframeEffect* keyframeEffectForElementAndProperty(const Styleable& styleable, CSSPropertyID property)
+static KeyframeEffect* keyframeEffectForElementAndProperty(const Styleable& styleable, CSSPropertyID resolvedProperty, CSSPropertyID unresolvedProperty)
 {
     if (auto* keyframeEffectStack = styleable.keyframeEffectStack()) {
         auto effects = keyframeEffectStack->sortedEffects();
         for (const auto& effect : makeReversedRange(effects)) {
-            if (effect->animatesProperty(property))
+            if (effect->animatesProperty(resolvedProperty) || (resolvedProperty != unresolvedProperty && effect->animatesProperty(unresolvedProperty)))
                 return effect.get();
         }
     }
@@ -348,7 +348,7 @@
     return std::max(0.0, transition->duration()) + transition->delay();
 }
 
-static bool transitionMatchesProperty(const Animation& transition, CSSPropertyID property)
+static bool transitionMatchesProperty(const Animation& transition, CSSPropertyID property, const RenderStyle& style)
 {
     if (transition.isPropertyFilled())
         return false;
@@ -357,7 +357,7 @@
     if (mode == Animation::TransitionMode::None || mode == Animation::TransitionMode::UnknownProperty)
         return false;
     if (mode == Animation::TransitionMode::SingleProperty) {
-        auto transitionProperty = transition.property().id;
+        auto transitionProperty = CSSProperty::resolveDirectionAwareProperty(transition.property().id, style.direction(), style.writingMode());
         if (transitionProperty != property) {
             for (auto longhand : shorthandForProperty(transitionProperty)) {
                 if (longhand == property)
@@ -396,7 +396,10 @@
 
 static void updateCSSTransitionsForStyleableAndProperty(const Styleable& styleable, CSSPropertyID property, const RenderStyle& currentStyle, const RenderStyle& newStyle, const MonotonicTime generationTime)
 {
-    auto* keyframeEffect = keyframeEffectForElementAndProperty(styleable, property);
+    auto unresolvedProperty = property;
+    property = CSSProperty::resolveDirectionAwareProperty(property, newStyle.direction(), newStyle.writingMode());
+
+    auto* keyframeEffect = keyframeEffectForElementAndProperty(styleable, property, unresolvedProperty);
     auto* animation = keyframeEffect ? keyframeEffect->animation() : nullptr;
 
     bool isDeclarative = false;
@@ -411,7 +414,7 @@
     const Animation* matchingBackingAnimation = nullptr;
     if (auto* transitions = newStyle.transitions()) {
         for (auto& backingAnimation : *transitions) {
-            if (transitionMatchesProperty(backingAnimation.get(), property))
+            if (transitionMatchesProperty(backingAnimation.get(), property, newStyle))
                 matchingBackingAnimation = backingAnimation.ptr();
         }
     }
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to