Title: [289426] trunk
Revision
289426
Author
[email protected]
Date
2022-02-08 14:06:14 -0800 (Tue, 08 Feb 2022)

Log Message

[css-logical] [css-animations] changing "direction" or "writing-mode" should recompute keyframes
https://bugs.webkit.org/show_bug.cgi?id=236293

Reviewed by Dean Jackson.

LayoutTests/imported/w3c:

Mark WPT progressions.

* web-platform-tests/css/css-logical/animation-002-expected.txt:

Source/WebCore:

We need to recompute keyframes based on the matching @keyframes rule in case an element running
a CSS Animation changes either "direction" or "writing-mode".

* animation/KeyframeEffect.cpp:
(WebCore::KeyframeEffect::propertyAffectingLogicalPropertiesDidChange):
* animation/KeyframeEffect.h:
* animation/KeyframeEffectStack.cpp:
(WebCore::KeyframeEffectStack::applyKeyframeEffects):

Modified Paths

Diff

Modified: trunk/LayoutTests/imported/w3c/ChangeLog (289425 => 289426)


--- trunk/LayoutTests/imported/w3c/ChangeLog	2022-02-08 21:45:59 UTC (rev 289425)
+++ trunk/LayoutTests/imported/w3c/ChangeLog	2022-02-08 22:06:14 UTC (rev 289426)
@@ -1,3 +1,14 @@
+2022-02-08  Antoine Quint  <[email protected]>
+
+        [css-logical] [css-animations] changing "direction" or "writing-mode" should recompute keyframes
+        https://bugs.webkit.org/show_bug.cgi?id=236293
+
+        Reviewed by Dean Jackson.
+
+        Mark WPT progressions.
+
+        * web-platform-tests/css/css-logical/animation-002-expected.txt:
+
 2022-02-08  Chris Dumez  <[email protected]>
 
         Resync workers/modules/shared-worker-import-meta.html from upstream WPT

Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-logical/animation-002-expected.txt (289425 => 289426)


--- trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-logical/animation-002-expected.txt	2022-02-08 21:45:59 UTC (rev 289425)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-logical/animation-002-expected.txt	2022-02-08 22:06:14 UTC (rev 289426)
@@ -7,11 +7,11 @@
 PASS Declaration order is respected amongst logical properties within @keyframes declaration blocks
 PASS Physical properties and logical properties can be mixed
 PASS Declaration order is respected on each keyframe individually
-FAIL Animations update when the writing-mode is changed assert_equals: expected "50px" but got "0px"
-FAIL Filling animations update when the writing-mode is changed assert_equals: expected "100px" but got "0px"
-FAIL The number of interpolating properties can be increased when the writing-mode is changed assert_equals: expected "50px" but got "0px"
-FAIL The number of interpolating properties can be decreased when the writing-mode is changed assert_equals: expected "150px" but got "200px"
-FAIL Animations update when the writing-mode is changed through a CSS variable assert_equals: expected "50px" but got "0px"
+PASS Animations update when the writing-mode is changed
+PASS Filling animations update when the writing-mode is changed
+PASS The number of interpolating properties can be increased when the writing-mode is changed
+PASS The number of interpolating properties can be decreased when the writing-mode is changed
+PASS Animations update when the writing-mode is changed through a CSS variable
 PASS Logical shorthand with variable references animates correctly
-FAIL Animations update when the direction is changed assert_equals: expected "0px" but got "50px"
+PASS Animations update when the direction is changed
 

Modified: trunk/Source/WebCore/ChangeLog (289425 => 289426)


--- trunk/Source/WebCore/ChangeLog	2022-02-08 21:45:59 UTC (rev 289425)
+++ trunk/Source/WebCore/ChangeLog	2022-02-08 22:06:14 UTC (rev 289426)
@@ -1,3 +1,19 @@
+2022-02-08  Antoine Quint  <[email protected]>
+
+        [css-logical] [css-animations] changing "direction" or "writing-mode" should recompute keyframes
+        https://bugs.webkit.org/show_bug.cgi?id=236293
+
+        Reviewed by Dean Jackson.
+
+        We need to recompute keyframes based on the matching @keyframes rule in case an element running
+        a CSS Animation changes either "direction" or "writing-mode".
+
+        * animation/KeyframeEffect.cpp:
+        (WebCore::KeyframeEffect::propertyAffectingLogicalPropertiesDidChange):
+        * animation/KeyframeEffect.h:
+        * animation/KeyframeEffectStack.cpp:
+        (WebCore::KeyframeEffectStack::applyKeyframeEffects):
+
 2022-02-08  Alan Bujtas  <[email protected]>
 
         [LFC][Integration] LineIteratorModernPath::baselineType should consult Display::Line

Modified: trunk/Source/WebCore/animation/KeyframeEffect.cpp (289425 => 289426)


--- trunk/Source/WebCore/animation/KeyframeEffect.cpp	2022-02-08 21:45:59 UTC (rev 289425)
+++ trunk/Source/WebCore/animation/KeyframeEffect.cpp	2022-02-08 22:06:14 UTC (rev 289426)
@@ -1701,10 +1701,18 @@
     addPendingAcceleratedAction(AcceleratedAction::TransformChange);
 }
 
-void KeyframeEffect::propertyAffectingLogicalPropertiesDidChange()
+void KeyframeEffect::propertyAffectingLogicalPropertiesDidChange(RenderStyle& unanimatedStyle, const Style::ResolutionContext& resolutionContext)
 {
-    if (m_blendingKeyframesSource == BlendingKeyframesSource::WebAnimation)
+    switch (m_blendingKeyframesSource) {
+    case BlendingKeyframesSource::CSSTransition:
+        return;
+    case BlendingKeyframesSource::CSSAnimation:
+        computeCSSAnimationBlendingKeyframes(unanimatedStyle, resolutionContext);
+        return;
+    case BlendingKeyframesSource::WebAnimation:
         clearBlendingKeyframes();
+        return;
+    }
 }
 
 void KeyframeEffect::animationWasCanceled()

Modified: trunk/Source/WebCore/animation/KeyframeEffect.h (289425 => 289426)


--- trunk/Source/WebCore/animation/KeyframeEffect.h	2022-02-08 21:45:59 UTC (rev 289425)
+++ trunk/Source/WebCore/animation/KeyframeEffect.h	2022-02-08 22:06:14 UTC (rev 289426)
@@ -126,7 +126,7 @@
 
     void animationTimingDidChange();
     void transformRelatedPropertyDidChange();
-    void propertyAffectingLogicalPropertiesDidChange();
+    void propertyAffectingLogicalPropertiesDidChange(RenderStyle&, const Style::ResolutionContext&);
     OptionSet<AcceleratedActionApplicationResult> applyPendingAcceleratedActions();
 
     void willChangeRenderer();

Modified: trunk/Source/WebCore/animation/KeyframeEffectStack.cpp (289425 => 289426)


--- trunk/Source/WebCore/animation/KeyframeEffectStack.cpp	2022-02-08 21:45:59 UTC (rev 289425)
+++ trunk/Source/WebCore/animation/KeyframeEffectStack.cpp	2022-02-08 22:06:14 UTC (rev 289426)
@@ -136,11 +136,13 @@
     auto propertyAffectingLogicalPropertiesChanged = previousLastStyleChangeEventStyle.direction() != targetStyle.direction()
         || previousLastStyleChangeEventStyle.writingMode() != targetStyle.writingMode();
 
+    auto unanimatedStyle = RenderStyle::clone(targetStyle);
+
     for (const auto& effect : sortedEffects()) {
         ASSERT(effect->animation());
 
         if (propertyAffectingLogicalPropertiesChanged)
-            effect->propertyAffectingLogicalPropertiesDidChange();
+            effect->propertyAffectingLogicalPropertiesDidChange(unanimatedStyle, resolutionContext);
 
         effect->animation()->resolve(targetStyle, resolutionContext);
 
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to