Title: [291008] trunk
Revision
291008
Author
[email protected]
Date
2022-03-08 13:25:12 -0800 (Tue, 08 Mar 2022)

Log Message

[web-animations] color-interpolation should support discrete animation
https://bugs.webkit.org/show_bug.cgi?id=237610

Reviewed by Tim Nguyen.

LayoutTests/imported/w3c:

Since the input for the strings used in comparison for the WPT tests is using toLowerCase(),
we need to also use toLowerCase() for the output, so that "linearRGB" and "linearrgb" are
both correct values for "color-interpolation" values.

* 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:
* web-platform-tests/web-animations/animation-model/animation-types/property-list.js:

Source/WebCore:

* animation/CSSPropertyAnimation.cpp:
(WebCore::CSSPropertyAnimationWrapperMap::CSSPropertyAnimationWrapperMap):
* rendering/style/RenderStyle.h:
(WebCore::RenderStyle::colorInterpolation const):
(WebCore::RenderStyle::setColorInterpolation):

Modified Paths

Diff

Modified: trunk/LayoutTests/imported/w3c/ChangeLog (291007 => 291008)


--- trunk/LayoutTests/imported/w3c/ChangeLog	2022-03-08 20:48:22 UTC (rev 291007)
+++ trunk/LayoutTests/imported/w3c/ChangeLog	2022-03-08 21:25:12 UTC (rev 291008)
@@ -1,3 +1,19 @@
+2022-03-08  Antoine Quint  <[email protected]>
+
+        [web-animations] color-interpolation should support discrete animation
+        https://bugs.webkit.org/show_bug.cgi?id=237610
+
+        Reviewed by Tim Nguyen.
+
+        Since the input for the strings used in comparison for the WPT tests is using toLowerCase(),
+        we need to also use toLowerCase() for the output, so that "linearRGB" and "linearrgb" are
+        both correct values for "color-interpolation" values.
+
+        * 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:
+        * web-platform-tests/web-animations/animation-model/animation-types/property-list.js:
+
 2022-03-08  Sihui Liu  <[email protected]>
 
         File System Access: disallow empty name in FileSystemHandle

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


--- trunk/LayoutTests/imported/w3c/web-platform-tests/web-animations/animation-model/animation-types/accumulation-per-property-001-expected.txt	2022-03-08 20:48:22 UTC (rev 291007)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/web-animations/animation-model/animation-types/accumulation-per-property-001-expected.txt	2022-03-08 21:25:12 UTC (rev 291008)
@@ -130,6 +130,9 @@
 PASS color supports animating as color of #RGBa
 PASS color supports animating as color of rgba()
 PASS color supports animating as color of hsla()
+PASS color-interpolation (type: discrete) has testAccumulation function
+PASS color-interpolation: "auto" onto "linearrgb"
+PASS color-interpolation: "linearrgb" onto "auto"
 PASS column-count (type: positiveInteger) has testAccumulation function
 PASS column-count: positive integer
 PASS column-count (type: discrete) has testAccumulation function

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


--- trunk/LayoutTests/imported/w3c/web-platform-tests/web-animations/animation-model/animation-types/addition-per-property-001-expected.txt	2022-03-08 20:48:22 UTC (rev 291007)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/web-animations/animation-model/animation-types/addition-per-property-001-expected.txt	2022-03-08 21:25:12 UTC (rev 291008)
@@ -130,6 +130,9 @@
 PASS color supports animating as color of #RGBa
 PASS color supports animating as color of rgba()
 PASS color supports animating as color of hsla()
+PASS color-interpolation (type: discrete) has testAddition function
+PASS color-interpolation: "auto" onto "linearrgb"
+PASS color-interpolation: "linearrgb" onto "auto"
 PASS column-count (type: positiveInteger) has testAddition function
 PASS column-count: positive integer
 PASS column-count (type: discrete) has testAddition function

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


--- trunk/LayoutTests/imported/w3c/web-platform-tests/web-animations/animation-model/animation-types/interpolation-per-property-001-expected.txt	2022-03-08 20:48:22 UTC (rev 291007)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/web-animations/animation-model/animation-types/interpolation-per-property-001-expected.txt	2022-03-08 21:25:12 UTC (rev 291008)
@@ -157,6 +157,10 @@
 PASS color supports animating as color of #RGBa
 PASS color supports animating as color of rgba()
 PASS color supports animating as color of hsla()
+PASS color-interpolation (type: discrete) has testInterpolation function
+PASS color-interpolation uses discrete animation when animating between "linearrgb" and "auto" with linear easing
+PASS color-interpolation uses discrete animation when animating between "linearrgb" and "auto" with effect easing
+PASS color-interpolation uses discrete animation when animating between "linearrgb" and "auto" with keyframe easing
 PASS column-count (type: positiveInteger) has testInterpolation function
 PASS column-count supports animating as a positive integer
 PASS column-count (type: discrete) has testInterpolation function

Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/web-animations/animation-model/animation-types/property-list.js (291007 => 291008)


--- trunk/LayoutTests/imported/w3c/web-platform-tests/web-animations/animation-model/animation-types/property-list.js	2022-03-08 20:48:22 UTC (rev 291007)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/web-animations/animation-model/animation-types/property-list.js	2022-03-08 21:25:12 UTC (rev 291008)
@@ -1424,7 +1424,7 @@
   const target = animation.effect.target;
   for (const testSample of testSamples) {
     animation.currentTime = testSample.time;
-    assert_equals(getComputedStyle(target, pseudoType)[idlName],
+    assert_equals(getComputedStyle(target, pseudoType)[idlName].toLowerCase(),
                   testSample.expected,
                   `The value should be ${testSample.expected}` +
                   ` at ${testSample.time}ms`);

Modified: trunk/Source/WebCore/ChangeLog (291007 => 291008)


--- trunk/Source/WebCore/ChangeLog	2022-03-08 20:48:22 UTC (rev 291007)
+++ trunk/Source/WebCore/ChangeLog	2022-03-08 21:25:12 UTC (rev 291008)
@@ -1,3 +1,16 @@
+2022-03-08  Antoine Quint  <[email protected]>
+
+        [web-animations] color-interpolation should support discrete animation
+        https://bugs.webkit.org/show_bug.cgi?id=237610
+
+        Reviewed by Tim Nguyen.
+
+        * animation/CSSPropertyAnimation.cpp:
+        (WebCore::CSSPropertyAnimationWrapperMap::CSSPropertyAnimationWrapperMap):
+        * rendering/style/RenderStyle.h:
+        (WebCore::RenderStyle::colorInterpolation const):
+        (WebCore::RenderStyle::setColorInterpolation):
+
 2022-03-08  Chris Dumez  <[email protected]>
 
         Optimize further the passing of data across threads

Modified: trunk/Source/WebCore/animation/CSSPropertyAnimation.cpp (291007 => 291008)


--- trunk/Source/WebCore/animation/CSSPropertyAnimation.cpp	2022-03-08 20:48:22 UTC (rev 291007)
+++ trunk/Source/WebCore/animation/CSSPropertyAnimation.cpp	2022-03-08 21:25:12 UTC (rev 291008)
@@ -2807,7 +2807,8 @@
         new LengthPointOrAutoPropertyWrapper(CSSPropertyOffsetAnchor, &RenderStyle::offsetAnchor, &RenderStyle::setOffsetAnchor),
         new PropertyWrapperContent,
         new OffsetRotatePropertyWrapper(CSSPropertyOffsetRotate, &RenderStyle::offsetRotate, &RenderStyle::setOffsetRotate),
-        new DiscretePropertyWrapper<TextDecorationSkipInk>(CSSPropertyTextDecorationSkipInk, &RenderStyle::textDecorationSkipInk, &RenderStyle::setTextDecorationSkipInk)
+        new DiscretePropertyWrapper<TextDecorationSkipInk>(CSSPropertyTextDecorationSkipInk, &RenderStyle::textDecorationSkipInk, &RenderStyle::setTextDecorationSkipInk),
+        new DiscretePropertyWrapper<ColorInterpolation>(CSSPropertyColorInterpolation, &RenderStyle::colorInterpolation, &RenderStyle::setColorInterpolation)
     };
     const unsigned animatableLonghandPropertiesCount = WTF_ARRAY_LENGTH(animatableLonghandPropertyWrappers);
 

Modified: trunk/Source/WebCore/rendering/style/RenderStyle.h (291007 => 291008)


--- trunk/Source/WebCore/rendering/style/RenderStyle.h	2022-03-08 20:48:22 UTC (rev 291007)
+++ trunk/Source/WebCore/rendering/style/RenderStyle.h	2022-03-08 21:25:12 UTC (rev 291008)
@@ -1422,6 +1422,9 @@
     const SVGRenderStyle& svgStyle() const { return m_svgStyle; }
     SVGRenderStyle& accessSVGStyle() { return m_svgStyle.access(); }
 
+    ColorInterpolation colorInterpolation() const { return svgStyle().colorInterpolation(); }
+    void setColorInterpolation(ColorInterpolation colorInterpolation) { accessSVGStyle().setColorInterpolation(colorInterpolation); }
+
     SVGPaintType fillPaintType() const { return svgStyle().fillPaintType(); }
     Color fillPaintColor() const { return svgStyle().fillPaintColor(); }
     void setFillPaintColor(const Color& color) { accessSVGStyle().setFillPaint(SVGPaintType::RGBColor, color, emptyString()); }
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to