Title: [291122] trunk
Revision
291122
Author
grao...@webkit.org
Date
2022-03-10 11:41:47 -0800 (Thu, 10 Mar 2022)

Log Message

[web-animations] grid-template-areas should support discrete animation
https://bugs.webkit.org/show_bug.cgi?id=237712

Reviewed by Antti Koivisto.

LayoutTests/imported/w3c:

While we now run the grid-template-areas tests, we have a bug in the way we serialize the value through the
computed style.

* web-platform-tests/web-animations/animation-model/animation-types/accumulation-per-property-001-expected.txt:
* web-platform-tests/web-animations/animation-model/animation-types/addition-per-property-001-expected.txt:
* web-platform-tests/web-animations/animation-model/animation-types/interpolation-per-property-001-expected.txt:

Source/WebCore:

* animation/CSSPropertyAnimation.cpp:
(WebCore::CSSPropertyAnimationWrapperMap::CSSPropertyAnimationWrapperMap):

Modified Paths

Diff

Modified: trunk/LayoutTests/imported/w3c/ChangeLog (291121 => 291122)


--- trunk/LayoutTests/imported/w3c/ChangeLog	2022-03-10 18:56:37 UTC (rev 291121)
+++ trunk/LayoutTests/imported/w3c/ChangeLog	2022-03-10 19:41:47 UTC (rev 291122)
@@ -1,5 +1,19 @@
 2022-03-10  Antoine Quint  <grao...@webkit.org>
 
+        [web-animations] grid-template-areas should support discrete animation
+        https://bugs.webkit.org/show_bug.cgi?id=237712
+
+        Reviewed by Antti Koivisto.
+
+        While we now run the grid-template-areas tests, we have a bug in the way we serialize the value through the
+        computed style.
+
+        * web-platform-tests/web-animations/animation-model/animation-types/accumulation-per-property-001-expected.txt:
+        * web-platform-tests/web-animations/animation-model/animation-types/addition-per-property-001-expected.txt:
+        * web-platform-tests/web-animations/animation-model/animation-types/interpolation-per-property-001-expected.txt:
+
+2022-03-10  Antoine Quint  <grao...@webkit.org>
+
         [web-animations] font-variant-caps should support discrete animation
         https://bugs.webkit.org/show_bug.cgi?id=237662
 

Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/web-animations/animation-model/animation-types/accumulation-per-property-001-expected.txt (291121 => 291122)


--- trunk/LayoutTests/imported/w3c/web-platform-tests/web-animations/animation-model/animation-types/accumulation-per-property-001-expected.txt	2022-03-10 18:56:37 UTC (rev 291121)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/web-animations/animation-model/animation-types/accumulation-per-property-001-expected.txt	2022-03-10 19:41:47 UTC (rev 291122)
@@ -297,6 +297,9 @@
 PASS grid-row-start (type: discrete) has testAccumulation function
 PASS grid-row-start: "5" onto "1"
 PASS grid-row-start: "1" onto "5"
+PASS grid-template-areas (type: discrete) has testAccumulation function
+PASS grid-template-areas: "none" onto "". . a b" ". .a b""
+FAIL grid-template-areas: "". . a b" ". .a b"" onto "none" assert_equals: The value should be ". . a b" ". .a b" at 0ms expected "\". . a b\" \". .a b\"" but got "\". . a b\" \". . a b\""
 PASS image-orientation (type: discrete) has testAccumulation function
 PASS image-orientation: "from-image" onto "none"
 PASS image-orientation: "none" onto "from-image"

Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/web-animations/animation-model/animation-types/addition-per-property-001-expected.txt (291121 => 291122)


--- trunk/LayoutTests/imported/w3c/web-platform-tests/web-animations/animation-model/animation-types/addition-per-property-001-expected.txt	2022-03-10 18:56:37 UTC (rev 291121)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/web-animations/animation-model/animation-types/addition-per-property-001-expected.txt	2022-03-10 19:41:47 UTC (rev 291122)
@@ -297,6 +297,9 @@
 PASS grid-row-start (type: discrete) has testAddition function
 PASS grid-row-start: "5" onto "1"
 PASS grid-row-start: "1" onto "5"
+PASS grid-template-areas (type: discrete) has testAddition function
+PASS grid-template-areas: "none" onto "". . a b" ". .a b""
+FAIL grid-template-areas: "". . a b" ". .a b"" onto "none" assert_equals: The value should be ". . a b" ". .a b" at 0ms expected "\". . a b\" \". .a b\"" but got "\". . a b\" \". . a b\""
 PASS image-orientation (type: discrete) has testAddition function
 PASS image-orientation: "from-image" onto "none"
 PASS image-orientation: "none" onto "from-image"

Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/web-animations/animation-model/animation-types/interpolation-per-property-001-expected.txt (291121 => 291122)


--- trunk/LayoutTests/imported/w3c/web-platform-tests/web-animations/animation-model/animation-types/interpolation-per-property-001-expected.txt	2022-03-10 18:56:37 UTC (rev 291121)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/web-animations/animation-model/animation-types/interpolation-per-property-001-expected.txt	2022-03-10 19:41:47 UTC (rev 291122)
@@ -368,6 +368,10 @@
 PASS grid-row-start uses discrete animation when animating between "1" and "5" with linear easing
 PASS grid-row-start uses discrete animation when animating between "1" and "5" with effect easing
 PASS grid-row-start uses discrete animation when animating between "1" and "5" with keyframe easing
+PASS grid-template-areas (type: discrete) has testInterpolation function
+FAIL grid-template-areas uses discrete animation when animating between "". . a b" ". .a b"" and "none" with linear easing assert_equals: The value should be ". . a b" ". .a b" at 0ms expected "\". . a b\" \". .a b\"" but got "\". . a b\" \". . a b\""
+FAIL grid-template-areas uses discrete animation when animating between "". . a b" ". .a b"" and "none" with effect easing assert_equals: The value should be ". . a b" ". .a b" at 0ms expected "\". . a b\" \". .a b\"" but got "\". . a b\" \". . a b\""
+FAIL grid-template-areas uses discrete animation when animating between "". . a b" ". .a b"" and "none" with keyframe easing assert_equals: The value should be ". . a b" ". .a b" at 0ms expected "\". . a b\" \". .a b\"" but got "\". . a b\" \". . a b\""
 PASS image-orientation (type: discrete) has testInterpolation function
 PASS image-orientation uses discrete animation when animating between "none" and "from-image" with linear easing
 PASS image-orientation uses discrete animation when animating between "none" and "from-image" with effect easing

Modified: trunk/Source/WebCore/ChangeLog (291121 => 291122)


--- trunk/Source/WebCore/ChangeLog	2022-03-10 18:56:37 UTC (rev 291121)
+++ trunk/Source/WebCore/ChangeLog	2022-03-10 19:41:47 UTC (rev 291122)
@@ -1,5 +1,15 @@
 2022-03-10  Antoine Quint  <grao...@webkit.org>
 
+        [web-animations] grid-template-areas should support discrete animation
+        https://bugs.webkit.org/show_bug.cgi?id=237712
+
+        Reviewed by Antti Koivisto.
+
+        * animation/CSSPropertyAnimation.cpp:
+        (WebCore::CSSPropertyAnimationWrapperMap::CSSPropertyAnimationWrapperMap):
+
+2022-03-10  Antoine Quint  <grao...@webkit.org>
+
         [web-animations] font-variant-caps should support discrete animation
         https://bugs.webkit.org/show_bug.cgi?id=237662
 

Modified: trunk/Source/WebCore/animation/CSSPropertyAnimation.cpp (291121 => 291122)


--- trunk/Source/WebCore/animation/CSSPropertyAnimation.cpp	2022-03-10 18:56:37 UTC (rev 291121)
+++ trunk/Source/WebCore/animation/CSSPropertyAnimation.cpp	2022-03-10 19:41:47 UTC (rev 291122)
@@ -2676,6 +2676,46 @@
 #endif
 };
 
+class GridTemplateAreasWrapper final : public AnimationPropertyWrapperBase {
+    WTF_MAKE_FAST_ALLOCATED;
+public:
+    GridTemplateAreasWrapper()
+        : AnimationPropertyWrapperBase(CSSPropertyGridTemplateAreas)
+    {
+    }
+
+    bool canInterpolate(const RenderStyle&, const RenderStyle&, CompositeOperation) const override { return false; }
+
+    bool equals(const RenderStyle& a, const RenderStyle& b) const final
+    {
+        return a.implicitNamedGridColumnLines() == b.implicitNamedGridColumnLines()
+            && a.implicitNamedGridRowLines() == b.implicitNamedGridRowLines()
+            && a.namedGridArea() == b.namedGridArea()
+            && a.namedGridAreaRowCount() == b.namedGridAreaRowCount()
+            && a.namedGridAreaColumnCount() == b.namedGridAreaColumnCount();
+    }
+
+#if !LOG_DISABLED
+    void logBlend(const RenderStyle&, const RenderStyle&, const RenderStyle&, double progress) const final
+    {
+        LOG_WITH_STREAM(Animations, stream << " blending " << getPropertyName(property()) << " at " << TextStream::FormatNumberRespectingIntegers(progress) << ".");
+    }
+#endif
+
+    void blend(RenderStyle& destination, const RenderStyle& from, const RenderStyle& to, const CSSPropertyBlendingContext& context) const final
+    {
+        ASSERT(context.isDiscrete);
+        ASSERT(!context.progress || context.progress == 1);
+
+        auto& source = context.progress ? to : from;
+        destination.setImplicitNamedGridColumnLines(source.implicitNamedGridColumnLines());
+        destination.setImplicitNamedGridRowLines(source.implicitNamedGridRowLines());
+        destination.setNamedGridArea(source.namedGridArea());
+        destination.setNamedGridAreaRowCount(source.namedGridAreaRowCount());
+        destination.setNamedGridAreaColumnCount(source.namedGridAreaColumnCount());
+    }
+};
+
 class CSSPropertyAnimationWrapperMap final {
     WTF_MAKE_FAST_ALLOCATED;
 public:
@@ -3016,7 +3056,8 @@
         new FontVariantEastAsianWrapper,
         new FontVariantLigaturesWrapper,
         new DiscretePropertyWrapper<FontVariantPosition>(CSSPropertyFontVariantPosition, &RenderStyle::fontVariantPosition, &RenderStyle::setFontVariantPosition),
-        new DiscretePropertyWrapper<FontVariantCaps>(CSSPropertyFontVariantCaps, &RenderStyle::fontVariantCaps, &RenderStyle::setFontVariantCaps)
+        new DiscretePropertyWrapper<FontVariantCaps>(CSSPropertyFontVariantCaps, &RenderStyle::fontVariantCaps, &RenderStyle::setFontVariantCaps),
+        new GridTemplateAreasWrapper
     };
     const unsigned animatableLonghandPropertiesCount = WTF_ARRAY_LENGTH(animatableLonghandPropertyWrappers);
 
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to