Title: [274391] trunk
Revision
274391
Author
[email protected]
Date
2021-03-13 12:00:21 -0800 (Sat, 13 Mar 2021)

Log Message

Fix interpolation of clip CSS property
https://bugs.webkit.org/show_bug.cgi?id=223126

Reviewed by Antti Koivisto.

LayoutTests/imported/w3c:

Import interpolation tests for clip. These tests pass completely
with 42 PASS results compared to prior to the source changes.

* web-platform-tests/css/css-masking/animations/clip-interpolation-expected.txt: Added.
* web-platform-tests/css/css-masking/animations/clip-interpolation.html: Added.

Source/WebCore:

Test: imported/w3c/web-platform-tests/css/css-masking/animations/clip-interpolation.html

While we already had support for interpolating the clip property, we had a couple of small
issues to fix to pass the entire WPT test dedicated to testing that feature:

    1. we must allow negative values
    2. we must serialize the value to "auto" if all four values are "auto"

* animation/CSSPropertyAnimation.cpp:
(WebCore::blendFunc):
(WebCore::CSSPropertyAnimationWrapperMap::CSSPropertyAnimationWrapperMap):
* css/CSSComputedStyleDeclaration.cpp:
(WebCore::ComputedStyleExtractor::valueForPropertyInStyle):

LayoutTests:

Rebase a test that used the old, incorrect computed value for "clip" with
four "auto" values.

* fast/css/computed-clip-with-auto-rect-expected.txt:

Modified Paths

Added Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (274390 => 274391)


--- trunk/LayoutTests/ChangeLog	2021-03-13 19:08:22 UTC (rev 274390)
+++ trunk/LayoutTests/ChangeLog	2021-03-13 20:00:21 UTC (rev 274391)
@@ -1,3 +1,15 @@
+2021-03-13  Antoine Quint  <[email protected]>
+
+        Fix interpolation of clip CSS property
+        https://bugs.webkit.org/show_bug.cgi?id=223126
+
+        Reviewed by Antti Koivisto.
+
+        Rebase a test that used the old, incorrect computed value for "clip" with
+        four "auto" values.
+
+        * fast/css/computed-clip-with-auto-rect-expected.txt:
+
 2021-03-13  Peng Liu  <[email protected]>
 
         [GPUP][MSE] MediaSource::buffered and MediaSource::activeSourceBuffers do not update in the same run loop as MediaSource::endOfStream()

Modified: trunk/LayoutTests/fast/css/computed-clip-with-auto-rect-expected.txt (274390 => 274391)


--- trunk/LayoutTests/fast/css/computed-clip-with-auto-rect-expected.txt	2021-03-13 19:08:22 UTC (rev 274390)
+++ trunk/LayoutTests/fast/css/computed-clip-with-auto-rect-expected.txt	2021-03-13 20:00:21 UTC (rev 274391)
@@ -1,11 +1,11 @@
-rect(auto, auto, auto, auto)
+auto
 
 rect(5px, auto, auto, auto)
 
 rect(auto, 5px, auto, auto)
 
-rect(auto, auto, 5px, auto)
+auto
 
-rect(auto, auto, auto, 5px)
+auto
 
 rect(5px, auto, 5px, auto)

Modified: trunk/LayoutTests/imported/w3c/ChangeLog (274390 => 274391)


--- trunk/LayoutTests/imported/w3c/ChangeLog	2021-03-13 19:08:22 UTC (rev 274390)
+++ trunk/LayoutTests/imported/w3c/ChangeLog	2021-03-13 20:00:21 UTC (rev 274391)
@@ -1,3 +1,16 @@
+2021-03-13  Antoine Quint  <[email protected]>
+
+        Fix interpolation of clip CSS property
+        https://bugs.webkit.org/show_bug.cgi?id=223126
+
+        Reviewed by Antti Koivisto.
+
+        Import interpolation tests for clip. These tests pass completely
+        with 42 PASS results compared to prior to the source changes.
+
+        * web-platform-tests/css/css-masking/animations/clip-interpolation-expected.txt: Added.
+        * web-platform-tests/css/css-masking/animations/clip-interpolation.html: Added.
+
 2021-03-13  Rob Buis  <[email protected]>
 
         [css-flexbox] Fix incorrect relative path

Added: trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-masking/animations/clip-interpolation-expected.txt (0 => 274391)


--- trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-masking/animations/clip-interpolation-expected.txt	                        (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-masking/animations/clip-interpolation-expected.txt	2021-03-13 20:00:21 UTC (rev 274391)
@@ -0,0 +1,242 @@
+
+PASS CSS Transitions: property <clip> from neutral to [rect(20px, 20px, 20px, 20px)] at (-1) should be [rect(-20px 180px -20px 180px)]
+PASS CSS Transitions: property <clip> from neutral to [rect(20px, 20px, 20px, 20px)] at (0) should be [rect(0px 100px 0px 100px)]
+PASS CSS Transitions: property <clip> from neutral to [rect(20px, 20px, 20px, 20px)] at (0.25) should be [rect(5px 80px 5px 80px)]
+PASS CSS Transitions: property <clip> from neutral to [rect(20px, 20px, 20px, 20px)] at (0.75) should be [rect(15px 40px 15px 40px)]
+PASS CSS Transitions: property <clip> from neutral to [rect(20px, 20px, 20px, 20px)] at (1) should be [rect(20px 20px 20px 20px)]
+PASS CSS Transitions: property <clip> from neutral to [rect(20px, 20px, 20px, 20px)] at (2) should be [rect(40px -60px 40px -60px)]
+PASS CSS Transitions with transition: all: property <clip> from neutral to [rect(20px, 20px, 20px, 20px)] at (-1) should be [rect(-20px 180px -20px 180px)]
+PASS CSS Transitions with transition: all: property <clip> from neutral to [rect(20px, 20px, 20px, 20px)] at (0) should be [rect(0px 100px 0px 100px)]
+PASS CSS Transitions with transition: all: property <clip> from neutral to [rect(20px, 20px, 20px, 20px)] at (0.25) should be [rect(5px 80px 5px 80px)]
+PASS CSS Transitions with transition: all: property <clip> from neutral to [rect(20px, 20px, 20px, 20px)] at (0.75) should be [rect(15px 40px 15px 40px)]
+PASS CSS Transitions with transition: all: property <clip> from neutral to [rect(20px, 20px, 20px, 20px)] at (1) should be [rect(20px 20px 20px 20px)]
+PASS CSS Transitions with transition: all: property <clip> from neutral to [rect(20px, 20px, 20px, 20px)] at (2) should be [rect(40px -60px 40px -60px)]
+PASS CSS Animations: property <clip> from neutral to [rect(20px, 20px, 20px, 20px)] at (-1) should be [rect(-20px 180px -20px 180px)]
+PASS CSS Animations: property <clip> from neutral to [rect(20px, 20px, 20px, 20px)] at (0) should be [rect(0px 100px 0px 100px)]
+PASS CSS Animations: property <clip> from neutral to [rect(20px, 20px, 20px, 20px)] at (0.25) should be [rect(5px 80px 5px 80px)]
+PASS CSS Animations: property <clip> from neutral to [rect(20px, 20px, 20px, 20px)] at (0.75) should be [rect(15px 40px 15px 40px)]
+PASS CSS Animations: property <clip> from neutral to [rect(20px, 20px, 20px, 20px)] at (1) should be [rect(20px 20px 20px 20px)]
+PASS CSS Animations: property <clip> from neutral to [rect(20px, 20px, 20px, 20px)] at (2) should be [rect(40px -60px 40px -60px)]
+PASS Web Animations: property <clip> from neutral to [rect(20px, 20px, 20px, 20px)] at (-1) should be [rect(-20px 180px -20px 180px)]
+PASS Web Animations: property <clip> from neutral to [rect(20px, 20px, 20px, 20px)] at (0) should be [rect(0px 100px 0px 100px)]
+PASS Web Animations: property <clip> from neutral to [rect(20px, 20px, 20px, 20px)] at (0.25) should be [rect(5px 80px 5px 80px)]
+PASS Web Animations: property <clip> from neutral to [rect(20px, 20px, 20px, 20px)] at (0.75) should be [rect(15px 40px 15px 40px)]
+PASS Web Animations: property <clip> from neutral to [rect(20px, 20px, 20px, 20px)] at (1) should be [rect(20px 20px 20px 20px)]
+PASS Web Animations: property <clip> from neutral to [rect(20px, 20px, 20px, 20px)] at (2) should be [rect(40px -60px 40px -60px)]
+PASS CSS Transitions: property <clip> from [initial] to [rect(20px, 20px, 20px, 20px)] at (-0.3) should be [rect(20px, 20px, 20px, 20px)]
+PASS CSS Transitions: property <clip> from [initial] to [rect(20px, 20px, 20px, 20px)] at (0) should be [rect(20px, 20px, 20px, 20px)]
+PASS CSS Transitions: property <clip> from [initial] to [rect(20px, 20px, 20px, 20px)] at (0.3) should be [rect(20px, 20px, 20px, 20px)]
+PASS CSS Transitions: property <clip> from [initial] to [rect(20px, 20px, 20px, 20px)] at (0.5) should be [rect(20px, 20px, 20px, 20px)]
+PASS CSS Transitions: property <clip> from [initial] to [rect(20px, 20px, 20px, 20px)] at (0.6) should be [rect(20px, 20px, 20px, 20px)]
+PASS CSS Transitions: property <clip> from [initial] to [rect(20px, 20px, 20px, 20px)] at (1) should be [rect(20px, 20px, 20px, 20px)]
+PASS CSS Transitions: property <clip> from [initial] to [rect(20px, 20px, 20px, 20px)] at (1.5) should be [rect(20px, 20px, 20px, 20px)]
+PASS CSS Transitions with transition: all: property <clip> from [initial] to [rect(20px, 20px, 20px, 20px)] at (-0.3) should be [rect(20px, 20px, 20px, 20px)]
+PASS CSS Transitions with transition: all: property <clip> from [initial] to [rect(20px, 20px, 20px, 20px)] at (0) should be [rect(20px, 20px, 20px, 20px)]
+PASS CSS Transitions with transition: all: property <clip> from [initial] to [rect(20px, 20px, 20px, 20px)] at (0.3) should be [rect(20px, 20px, 20px, 20px)]
+PASS CSS Transitions with transition: all: property <clip> from [initial] to [rect(20px, 20px, 20px, 20px)] at (0.5) should be [rect(20px, 20px, 20px, 20px)]
+PASS CSS Transitions with transition: all: property <clip> from [initial] to [rect(20px, 20px, 20px, 20px)] at (0.6) should be [rect(20px, 20px, 20px, 20px)]
+PASS CSS Transitions with transition: all: property <clip> from [initial] to [rect(20px, 20px, 20px, 20px)] at (1) should be [rect(20px, 20px, 20px, 20px)]
+PASS CSS Transitions with transition: all: property <clip> from [initial] to [rect(20px, 20px, 20px, 20px)] at (1.5) should be [rect(20px, 20px, 20px, 20px)]
+PASS CSS Animations: property <clip> from [initial] to [rect(20px, 20px, 20px, 20px)] at (-0.3) should be [initial]
+PASS CSS Animations: property <clip> from [initial] to [rect(20px, 20px, 20px, 20px)] at (0) should be [initial]
+PASS CSS Animations: property <clip> from [initial] to [rect(20px, 20px, 20px, 20px)] at (0.3) should be [initial]
+PASS CSS Animations: property <clip> from [initial] to [rect(20px, 20px, 20px, 20px)] at (0.5) should be [rect(20px, 20px, 20px, 20px)]
+PASS CSS Animations: property <clip> from [initial] to [rect(20px, 20px, 20px, 20px)] at (0.6) should be [rect(20px, 20px, 20px, 20px)]
+PASS CSS Animations: property <clip> from [initial] to [rect(20px, 20px, 20px, 20px)] at (1) should be [rect(20px, 20px, 20px, 20px)]
+PASS CSS Animations: property <clip> from [initial] to [rect(20px, 20px, 20px, 20px)] at (1.5) should be [rect(20px, 20px, 20px, 20px)]
+PASS Web Animations: property <clip> from [initial] to [rect(20px, 20px, 20px, 20px)] at (-0.3) should be [initial]
+PASS Web Animations: property <clip> from [initial] to [rect(20px, 20px, 20px, 20px)] at (0) should be [initial]
+PASS Web Animations: property <clip> from [initial] to [rect(20px, 20px, 20px, 20px)] at (0.3) should be [initial]
+PASS Web Animations: property <clip> from [initial] to [rect(20px, 20px, 20px, 20px)] at (0.5) should be [rect(20px, 20px, 20px, 20px)]
+PASS Web Animations: property <clip> from [initial] to [rect(20px, 20px, 20px, 20px)] at (0.6) should be [rect(20px, 20px, 20px, 20px)]
+PASS Web Animations: property <clip> from [initial] to [rect(20px, 20px, 20px, 20px)] at (1) should be [rect(20px, 20px, 20px, 20px)]
+PASS Web Animations: property <clip> from [initial] to [rect(20px, 20px, 20px, 20px)] at (1.5) should be [rect(20px, 20px, 20px, 20px)]
+PASS CSS Transitions: property <clip> from [inherit] to [rect(20px, 20px, 20px, 20px)] at (-1) should be [rect(180px -20px 180px -20px)]
+PASS CSS Transitions: property <clip> from [inherit] to [rect(20px, 20px, 20px, 20px)] at (0) should be [rect(100px 0px 100px 0px)]
+PASS CSS Transitions: property <clip> from [inherit] to [rect(20px, 20px, 20px, 20px)] at (0.25) should be [rect(80px 5px 80px 5px)]
+PASS CSS Transitions: property <clip> from [inherit] to [rect(20px, 20px, 20px, 20px)] at (0.75) should be [rect(40px 15px 40px 15px)]
+PASS CSS Transitions: property <clip> from [inherit] to [rect(20px, 20px, 20px, 20px)] at (1) should be [rect(20px 20px 20px 20px)]
+PASS CSS Transitions: property <clip> from [inherit] to [rect(20px, 20px, 20px, 20px)] at (2) should be [rect(-60px 40px -60px 40px)]
+PASS CSS Transitions with transition: all: property <clip> from [inherit] to [rect(20px, 20px, 20px, 20px)] at (-1) should be [rect(180px -20px 180px -20px)]
+PASS CSS Transitions with transition: all: property <clip> from [inherit] to [rect(20px, 20px, 20px, 20px)] at (0) should be [rect(100px 0px 100px 0px)]
+PASS CSS Transitions with transition: all: property <clip> from [inherit] to [rect(20px, 20px, 20px, 20px)] at (0.25) should be [rect(80px 5px 80px 5px)]
+PASS CSS Transitions with transition: all: property <clip> from [inherit] to [rect(20px, 20px, 20px, 20px)] at (0.75) should be [rect(40px 15px 40px 15px)]
+PASS CSS Transitions with transition: all: property <clip> from [inherit] to [rect(20px, 20px, 20px, 20px)] at (1) should be [rect(20px 20px 20px 20px)]
+PASS CSS Transitions with transition: all: property <clip> from [inherit] to [rect(20px, 20px, 20px, 20px)] at (2) should be [rect(-60px 40px -60px 40px)]
+PASS CSS Animations: property <clip> from [inherit] to [rect(20px, 20px, 20px, 20px)] at (-1) should be [rect(180px -20px 180px -20px)]
+PASS CSS Animations: property <clip> from [inherit] to [rect(20px, 20px, 20px, 20px)] at (0) should be [rect(100px 0px 100px 0px)]
+PASS CSS Animations: property <clip> from [inherit] to [rect(20px, 20px, 20px, 20px)] at (0.25) should be [rect(80px 5px 80px 5px)]
+PASS CSS Animations: property <clip> from [inherit] to [rect(20px, 20px, 20px, 20px)] at (0.75) should be [rect(40px 15px 40px 15px)]
+PASS CSS Animations: property <clip> from [inherit] to [rect(20px, 20px, 20px, 20px)] at (1) should be [rect(20px 20px 20px 20px)]
+PASS CSS Animations: property <clip> from [inherit] to [rect(20px, 20px, 20px, 20px)] at (2) should be [rect(-60px 40px -60px 40px)]
+PASS Web Animations: property <clip> from [inherit] to [rect(20px, 20px, 20px, 20px)] at (-1) should be [rect(180px -20px 180px -20px)]
+PASS Web Animations: property <clip> from [inherit] to [rect(20px, 20px, 20px, 20px)] at (0) should be [rect(100px 0px 100px 0px)]
+PASS Web Animations: property <clip> from [inherit] to [rect(20px, 20px, 20px, 20px)] at (0.25) should be [rect(80px 5px 80px 5px)]
+PASS Web Animations: property <clip> from [inherit] to [rect(20px, 20px, 20px, 20px)] at (0.75) should be [rect(40px 15px 40px 15px)]
+PASS Web Animations: property <clip> from [inherit] to [rect(20px, 20px, 20px, 20px)] at (1) should be [rect(20px 20px 20px 20px)]
+PASS Web Animations: property <clip> from [inherit] to [rect(20px, 20px, 20px, 20px)] at (2) should be [rect(-60px 40px -60px 40px)]
+PASS CSS Transitions: property <clip> from [unset] to [rect(20px, 20px, 20px, 20px)] at (-0.3) should be [rect(20px, 20px, 20px, 20px)]
+PASS CSS Transitions: property <clip> from [unset] to [rect(20px, 20px, 20px, 20px)] at (0) should be [rect(20px, 20px, 20px, 20px)]
+PASS CSS Transitions: property <clip> from [unset] to [rect(20px, 20px, 20px, 20px)] at (0.3) should be [rect(20px, 20px, 20px, 20px)]
+PASS CSS Transitions: property <clip> from [unset] to [rect(20px, 20px, 20px, 20px)] at (0.5) should be [rect(20px, 20px, 20px, 20px)]
+PASS CSS Transitions: property <clip> from [unset] to [rect(20px, 20px, 20px, 20px)] at (0.6) should be [rect(20px, 20px, 20px, 20px)]
+PASS CSS Transitions: property <clip> from [unset] to [rect(20px, 20px, 20px, 20px)] at (1) should be [rect(20px, 20px, 20px, 20px)]
+PASS CSS Transitions: property <clip> from [unset] to [rect(20px, 20px, 20px, 20px)] at (1.5) should be [rect(20px, 20px, 20px, 20px)]
+PASS CSS Transitions with transition: all: property <clip> from [unset] to [rect(20px, 20px, 20px, 20px)] at (-0.3) should be [rect(20px, 20px, 20px, 20px)]
+PASS CSS Transitions with transition: all: property <clip> from [unset] to [rect(20px, 20px, 20px, 20px)] at (0) should be [rect(20px, 20px, 20px, 20px)]
+PASS CSS Transitions with transition: all: property <clip> from [unset] to [rect(20px, 20px, 20px, 20px)] at (0.3) should be [rect(20px, 20px, 20px, 20px)]
+PASS CSS Transitions with transition: all: property <clip> from [unset] to [rect(20px, 20px, 20px, 20px)] at (0.5) should be [rect(20px, 20px, 20px, 20px)]
+PASS CSS Transitions with transition: all: property <clip> from [unset] to [rect(20px, 20px, 20px, 20px)] at (0.6) should be [rect(20px, 20px, 20px, 20px)]
+PASS CSS Transitions with transition: all: property <clip> from [unset] to [rect(20px, 20px, 20px, 20px)] at (1) should be [rect(20px, 20px, 20px, 20px)]
+PASS CSS Transitions with transition: all: property <clip> from [unset] to [rect(20px, 20px, 20px, 20px)] at (1.5) should be [rect(20px, 20px, 20px, 20px)]
+PASS CSS Animations: property <clip> from [unset] to [rect(20px, 20px, 20px, 20px)] at (-0.3) should be [unset]
+PASS CSS Animations: property <clip> from [unset] to [rect(20px, 20px, 20px, 20px)] at (0) should be [unset]
+PASS CSS Animations: property <clip> from [unset] to [rect(20px, 20px, 20px, 20px)] at (0.3) should be [unset]
+PASS CSS Animations: property <clip> from [unset] to [rect(20px, 20px, 20px, 20px)] at (0.5) should be [rect(20px, 20px, 20px, 20px)]
+PASS CSS Animations: property <clip> from [unset] to [rect(20px, 20px, 20px, 20px)] at (0.6) should be [rect(20px, 20px, 20px, 20px)]
+PASS CSS Animations: property <clip> from [unset] to [rect(20px, 20px, 20px, 20px)] at (1) should be [rect(20px, 20px, 20px, 20px)]
+PASS CSS Animations: property <clip> from [unset] to [rect(20px, 20px, 20px, 20px)] at (1.5) should be [rect(20px, 20px, 20px, 20px)]
+PASS Web Animations: property <clip> from [unset] to [rect(20px, 20px, 20px, 20px)] at (-0.3) should be [unset]
+PASS Web Animations: property <clip> from [unset] to [rect(20px, 20px, 20px, 20px)] at (0) should be [unset]
+PASS Web Animations: property <clip> from [unset] to [rect(20px, 20px, 20px, 20px)] at (0.3) should be [unset]
+PASS Web Animations: property <clip> from [unset] to [rect(20px, 20px, 20px, 20px)] at (0.5) should be [rect(20px, 20px, 20px, 20px)]
+PASS Web Animations: property <clip> from [unset] to [rect(20px, 20px, 20px, 20px)] at (0.6) should be [rect(20px, 20px, 20px, 20px)]
+PASS Web Animations: property <clip> from [unset] to [rect(20px, 20px, 20px, 20px)] at (1) should be [rect(20px, 20px, 20px, 20px)]
+PASS Web Animations: property <clip> from [unset] to [rect(20px, 20px, 20px, 20px)] at (1.5) should be [rect(20px, 20px, 20px, 20px)]
+PASS CSS Transitions: property <clip> from [rect(0px, 75px, 80px, 10px)] to [rect(0px, 100px, 90px, 5px)] at (-1) should be [rect(0px, 50px, 70px, 15px)]
+PASS CSS Transitions: property <clip> from [rect(0px, 75px, 80px, 10px)] to [rect(0px, 100px, 90px, 5px)] at (0) should be [rect(0px, 75px, 80px, 10px)]
+PASS CSS Transitions: property <clip> from [rect(0px, 75px, 80px, 10px)] to [rect(0px, 100px, 90px, 5px)] at (0.25) should be [rect(0px, 81.25px, 82.5px, 8.75px)]
+PASS CSS Transitions: property <clip> from [rect(0px, 75px, 80px, 10px)] to [rect(0px, 100px, 90px, 5px)] at (0.75) should be [rect(0px, 93.75px, 87.5px, 6.25px)]
+PASS CSS Transitions: property <clip> from [rect(0px, 75px, 80px, 10px)] to [rect(0px, 100px, 90px, 5px)] at (1) should be [rect(0px, 100px, 90px, 5px)]
+PASS CSS Transitions: property <clip> from [rect(0px, 75px, 80px, 10px)] to [rect(0px, 100px, 90px, 5px)] at (2) should be [rect(0px, 125px, 100px, 0px)]
+PASS CSS Transitions with transition: all: property <clip> from [rect(0px, 75px, 80px, 10px)] to [rect(0px, 100px, 90px, 5px)] at (-1) should be [rect(0px, 50px, 70px, 15px)]
+PASS CSS Transitions with transition: all: property <clip> from [rect(0px, 75px, 80px, 10px)] to [rect(0px, 100px, 90px, 5px)] at (0) should be [rect(0px, 75px, 80px, 10px)]
+PASS CSS Transitions with transition: all: property <clip> from [rect(0px, 75px, 80px, 10px)] to [rect(0px, 100px, 90px, 5px)] at (0.25) should be [rect(0px, 81.25px, 82.5px, 8.75px)]
+PASS CSS Transitions with transition: all: property <clip> from [rect(0px, 75px, 80px, 10px)] to [rect(0px, 100px, 90px, 5px)] at (0.75) should be [rect(0px, 93.75px, 87.5px, 6.25px)]
+PASS CSS Transitions with transition: all: property <clip> from [rect(0px, 75px, 80px, 10px)] to [rect(0px, 100px, 90px, 5px)] at (1) should be [rect(0px, 100px, 90px, 5px)]
+PASS CSS Transitions with transition: all: property <clip> from [rect(0px, 75px, 80px, 10px)] to [rect(0px, 100px, 90px, 5px)] at (2) should be [rect(0px, 125px, 100px, 0px)]
+PASS CSS Animations: property <clip> from [rect(0px, 75px, 80px, 10px)] to [rect(0px, 100px, 90px, 5px)] at (-1) should be [rect(0px, 50px, 70px, 15px)]
+PASS CSS Animations: property <clip> from [rect(0px, 75px, 80px, 10px)] to [rect(0px, 100px, 90px, 5px)] at (0) should be [rect(0px, 75px, 80px, 10px)]
+PASS CSS Animations: property <clip> from [rect(0px, 75px, 80px, 10px)] to [rect(0px, 100px, 90px, 5px)] at (0.25) should be [rect(0px, 81.25px, 82.5px, 8.75px)]
+PASS CSS Animations: property <clip> from [rect(0px, 75px, 80px, 10px)] to [rect(0px, 100px, 90px, 5px)] at (0.75) should be [rect(0px, 93.75px, 87.5px, 6.25px)]
+PASS CSS Animations: property <clip> from [rect(0px, 75px, 80px, 10px)] to [rect(0px, 100px, 90px, 5px)] at (1) should be [rect(0px, 100px, 90px, 5px)]
+PASS CSS Animations: property <clip> from [rect(0px, 75px, 80px, 10px)] to [rect(0px, 100px, 90px, 5px)] at (2) should be [rect(0px, 125px, 100px, 0px)]
+PASS Web Animations: property <clip> from [rect(0px, 75px, 80px, 10px)] to [rect(0px, 100px, 90px, 5px)] at (-1) should be [rect(0px, 50px, 70px, 15px)]
+PASS Web Animations: property <clip> from [rect(0px, 75px, 80px, 10px)] to [rect(0px, 100px, 90px, 5px)] at (0) should be [rect(0px, 75px, 80px, 10px)]
+PASS Web Animations: property <clip> from [rect(0px, 75px, 80px, 10px)] to [rect(0px, 100px, 90px, 5px)] at (0.25) should be [rect(0px, 81.25px, 82.5px, 8.75px)]
+PASS Web Animations: property <clip> from [rect(0px, 75px, 80px, 10px)] to [rect(0px, 100px, 90px, 5px)] at (0.75) should be [rect(0px, 93.75px, 87.5px, 6.25px)]
+PASS Web Animations: property <clip> from [rect(0px, 75px, 80px, 10px)] to [rect(0px, 100px, 90px, 5px)] at (1) should be [rect(0px, 100px, 90px, 5px)]
+PASS Web Animations: property <clip> from [rect(0px, 75px, 80px, 10px)] to [rect(0px, 100px, 90px, 5px)] at (2) should be [rect(0px, 125px, 100px, 0px)]
+PASS CSS Transitions: property <clip> from [rect(auto, auto, auto, 10px)] to [rect(20px, 50px, 50px, auto)] at (-0.3) should be [rect(20px, 50px, 50px, auto)]
+PASS CSS Transitions: property <clip> from [rect(auto, auto, auto, 10px)] to [rect(20px, 50px, 50px, auto)] at (0) should be [rect(20px, 50px, 50px, auto)]
+PASS CSS Transitions: property <clip> from [rect(auto, auto, auto, 10px)] to [rect(20px, 50px, 50px, auto)] at (0.3) should be [rect(20px, 50px, 50px, auto)]
+PASS CSS Transitions: property <clip> from [rect(auto, auto, auto, 10px)] to [rect(20px, 50px, 50px, auto)] at (0.5) should be [rect(20px, 50px, 50px, auto)]
+PASS CSS Transitions: property <clip> from [rect(auto, auto, auto, 10px)] to [rect(20px, 50px, 50px, auto)] at (0.6) should be [rect(20px, 50px, 50px, auto)]
+PASS CSS Transitions: property <clip> from [rect(auto, auto, auto, 10px)] to [rect(20px, 50px, 50px, auto)] at (1) should be [rect(20px, 50px, 50px, auto)]
+PASS CSS Transitions: property <clip> from [rect(auto, auto, auto, 10px)] to [rect(20px, 50px, 50px, auto)] at (1.5) should be [rect(20px, 50px, 50px, auto)]
+PASS CSS Transitions with transition: all: property <clip> from [rect(auto, auto, auto, 10px)] to [rect(20px, 50px, 50px, auto)] at (-0.3) should be [rect(20px, 50px, 50px, auto)]
+PASS CSS Transitions with transition: all: property <clip> from [rect(auto, auto, auto, 10px)] to [rect(20px, 50px, 50px, auto)] at (0) should be [rect(20px, 50px, 50px, auto)]
+PASS CSS Transitions with transition: all: property <clip> from [rect(auto, auto, auto, 10px)] to [rect(20px, 50px, 50px, auto)] at (0.3) should be [rect(20px, 50px, 50px, auto)]
+PASS CSS Transitions with transition: all: property <clip> from [rect(auto, auto, auto, 10px)] to [rect(20px, 50px, 50px, auto)] at (0.5) should be [rect(20px, 50px, 50px, auto)]
+PASS CSS Transitions with transition: all: property <clip> from [rect(auto, auto, auto, 10px)] to [rect(20px, 50px, 50px, auto)] at (0.6) should be [rect(20px, 50px, 50px, auto)]
+PASS CSS Transitions with transition: all: property <clip> from [rect(auto, auto, auto, 10px)] to [rect(20px, 50px, 50px, auto)] at (1) should be [rect(20px, 50px, 50px, auto)]
+PASS CSS Transitions with transition: all: property <clip> from [rect(auto, auto, auto, 10px)] to [rect(20px, 50px, 50px, auto)] at (1.5) should be [rect(20px, 50px, 50px, auto)]
+PASS CSS Animations: property <clip> from [rect(auto, auto, auto, 10px)] to [rect(20px, 50px, 50px, auto)] at (-0.3) should be [rect(auto, auto, auto, 10px)]
+PASS CSS Animations: property <clip> from [rect(auto, auto, auto, 10px)] to [rect(20px, 50px, 50px, auto)] at (0) should be [rect(auto, auto, auto, 10px)]
+PASS CSS Animations: property <clip> from [rect(auto, auto, auto, 10px)] to [rect(20px, 50px, 50px, auto)] at (0.3) should be [rect(auto, auto, auto, 10px)]
+PASS CSS Animations: property <clip> from [rect(auto, auto, auto, 10px)] to [rect(20px, 50px, 50px, auto)] at (0.5) should be [rect(20px, 50px, 50px, auto)]
+PASS CSS Animations: property <clip> from [rect(auto, auto, auto, 10px)] to [rect(20px, 50px, 50px, auto)] at (0.6) should be [rect(20px, 50px, 50px, auto)]
+PASS CSS Animations: property <clip> from [rect(auto, auto, auto, 10px)] to [rect(20px, 50px, 50px, auto)] at (1) should be [rect(20px, 50px, 50px, auto)]
+PASS CSS Animations: property <clip> from [rect(auto, auto, auto, 10px)] to [rect(20px, 50px, 50px, auto)] at (1.5) should be [rect(20px, 50px, 50px, auto)]
+PASS Web Animations: property <clip> from [rect(auto, auto, auto, 10px)] to [rect(20px, 50px, 50px, auto)] at (-0.3) should be [rect(auto, auto, auto, 10px)]
+PASS Web Animations: property <clip> from [rect(auto, auto, auto, 10px)] to [rect(20px, 50px, 50px, auto)] at (0) should be [rect(auto, auto, auto, 10px)]
+PASS Web Animations: property <clip> from [rect(auto, auto, auto, 10px)] to [rect(20px, 50px, 50px, auto)] at (0.3) should be [rect(auto, auto, auto, 10px)]
+PASS Web Animations: property <clip> from [rect(auto, auto, auto, 10px)] to [rect(20px, 50px, 50px, auto)] at (0.5) should be [rect(20px, 50px, 50px, auto)]
+PASS Web Animations: property <clip> from [rect(auto, auto, auto, 10px)] to [rect(20px, 50px, 50px, auto)] at (0.6) should be [rect(20px, 50px, 50px, auto)]
+PASS Web Animations: property <clip> from [rect(auto, auto, auto, 10px)] to [rect(20px, 50px, 50px, auto)] at (1) should be [rect(20px, 50px, 50px, auto)]
+PASS Web Animations: property <clip> from [rect(auto, auto, auto, 10px)] to [rect(20px, 50px, 50px, auto)] at (1.5) should be [rect(20px, 50px, 50px, auto)]
+PASS CSS Transitions: property <clip> from [rect(auto, 0px, auto, 10px)] to [rect(auto, 50px, 50px, auto)] at (-0.3) should be [rect(auto, 50px, 50px, auto)]
+PASS CSS Transitions: property <clip> from [rect(auto, 0px, auto, 10px)] to [rect(auto, 50px, 50px, auto)] at (0) should be [rect(auto, 50px, 50px, auto)]
+PASS CSS Transitions: property <clip> from [rect(auto, 0px, auto, 10px)] to [rect(auto, 50px, 50px, auto)] at (0.3) should be [rect(auto, 50px, 50px, auto)]
+PASS CSS Transitions: property <clip> from [rect(auto, 0px, auto, 10px)] to [rect(auto, 50px, 50px, auto)] at (0.5) should be [rect(auto, 50px, 50px, auto)]
+PASS CSS Transitions: property <clip> from [rect(auto, 0px, auto, 10px)] to [rect(auto, 50px, 50px, auto)] at (0.6) should be [rect(auto, 50px, 50px, auto)]
+PASS CSS Transitions: property <clip> from [rect(auto, 0px, auto, 10px)] to [rect(auto, 50px, 50px, auto)] at (1) should be [rect(auto, 50px, 50px, auto)]
+PASS CSS Transitions: property <clip> from [rect(auto, 0px, auto, 10px)] to [rect(auto, 50px, 50px, auto)] at (1.5) should be [rect(auto, 50px, 50px, auto)]
+PASS CSS Transitions with transition: all: property <clip> from [rect(auto, 0px, auto, 10px)] to [rect(auto, 50px, 50px, auto)] at (-0.3) should be [rect(auto, 50px, 50px, auto)]
+PASS CSS Transitions with transition: all: property <clip> from [rect(auto, 0px, auto, 10px)] to [rect(auto, 50px, 50px, auto)] at (0) should be [rect(auto, 50px, 50px, auto)]
+PASS CSS Transitions with transition: all: property <clip> from [rect(auto, 0px, auto, 10px)] to [rect(auto, 50px, 50px, auto)] at (0.3) should be [rect(auto, 50px, 50px, auto)]
+PASS CSS Transitions with transition: all: property <clip> from [rect(auto, 0px, auto, 10px)] to [rect(auto, 50px, 50px, auto)] at (0.5) should be [rect(auto, 50px, 50px, auto)]
+PASS CSS Transitions with transition: all: property <clip> from [rect(auto, 0px, auto, 10px)] to [rect(auto, 50px, 50px, auto)] at (0.6) should be [rect(auto, 50px, 50px, auto)]
+PASS CSS Transitions with transition: all: property <clip> from [rect(auto, 0px, auto, 10px)] to [rect(auto, 50px, 50px, auto)] at (1) should be [rect(auto, 50px, 50px, auto)]
+PASS CSS Transitions with transition: all: property <clip> from [rect(auto, 0px, auto, 10px)] to [rect(auto, 50px, 50px, auto)] at (1.5) should be [rect(auto, 50px, 50px, auto)]
+PASS CSS Animations: property <clip> from [rect(auto, 0px, auto, 10px)] to [rect(auto, 50px, 50px, auto)] at (-0.3) should be [rect(auto, 0px, auto, 10px)]
+PASS CSS Animations: property <clip> from [rect(auto, 0px, auto, 10px)] to [rect(auto, 50px, 50px, auto)] at (0) should be [rect(auto, 0px, auto, 10px)]
+PASS CSS Animations: property <clip> from [rect(auto, 0px, auto, 10px)] to [rect(auto, 50px, 50px, auto)] at (0.3) should be [rect(auto, 0px, auto, 10px)]
+PASS CSS Animations: property <clip> from [rect(auto, 0px, auto, 10px)] to [rect(auto, 50px, 50px, auto)] at (0.5) should be [rect(auto, 50px, 50px, auto)]
+PASS CSS Animations: property <clip> from [rect(auto, 0px, auto, 10px)] to [rect(auto, 50px, 50px, auto)] at (0.6) should be [rect(auto, 50px, 50px, auto)]
+PASS CSS Animations: property <clip> from [rect(auto, 0px, auto, 10px)] to [rect(auto, 50px, 50px, auto)] at (1) should be [rect(auto, 50px, 50px, auto)]
+PASS CSS Animations: property <clip> from [rect(auto, 0px, auto, 10px)] to [rect(auto, 50px, 50px, auto)] at (1.5) should be [rect(auto, 50px, 50px, auto)]
+PASS Web Animations: property <clip> from [rect(auto, 0px, auto, 10px)] to [rect(auto, 50px, 50px, auto)] at (-0.3) should be [rect(auto, 0px, auto, 10px)]
+PASS Web Animations: property <clip> from [rect(auto, 0px, auto, 10px)] to [rect(auto, 50px, 50px, auto)] at (0) should be [rect(auto, 0px, auto, 10px)]
+PASS Web Animations: property <clip> from [rect(auto, 0px, auto, 10px)] to [rect(auto, 50px, 50px, auto)] at (0.3) should be [rect(auto, 0px, auto, 10px)]
+PASS Web Animations: property <clip> from [rect(auto, 0px, auto, 10px)] to [rect(auto, 50px, 50px, auto)] at (0.5) should be [rect(auto, 50px, 50px, auto)]
+PASS Web Animations: property <clip> from [rect(auto, 0px, auto, 10px)] to [rect(auto, 50px, 50px, auto)] at (0.6) should be [rect(auto, 50px, 50px, auto)]
+PASS Web Animations: property <clip> from [rect(auto, 0px, auto, 10px)] to [rect(auto, 50px, 50px, auto)] at (1) should be [rect(auto, 50px, 50px, auto)]
+PASS Web Animations: property <clip> from [rect(auto, 0px, auto, 10px)] to [rect(auto, 50px, 50px, auto)] at (1.5) should be [rect(auto, 50px, 50px, auto)]
+PASS CSS Transitions: property <clip> from [auto] to [rect(0px, 50px, 50px, 0px)] at (-0.3) should be [rect(0px, 50px, 50px, 0px)]
+PASS CSS Transitions: property <clip> from [auto] to [rect(0px, 50px, 50px, 0px)] at (0) should be [rect(0px, 50px, 50px, 0px)]
+PASS CSS Transitions: property <clip> from [auto] to [rect(0px, 50px, 50px, 0px)] at (0.3) should be [rect(0px, 50px, 50px, 0px)]
+PASS CSS Transitions: property <clip> from [auto] to [rect(0px, 50px, 50px, 0px)] at (0.5) should be [rect(0px, 50px, 50px, 0px)]
+PASS CSS Transitions: property <clip> from [auto] to [rect(0px, 50px, 50px, 0px)] at (0.6) should be [rect(0px, 50px, 50px, 0px)]
+PASS CSS Transitions: property <clip> from [auto] to [rect(0px, 50px, 50px, 0px)] at (1) should be [rect(0px, 50px, 50px, 0px)]
+PASS CSS Transitions: property <clip> from [auto] to [rect(0px, 50px, 50px, 0px)] at (1.5) should be [rect(0px, 50px, 50px, 0px)]
+PASS CSS Transitions with transition: all: property <clip> from [auto] to [rect(0px, 50px, 50px, 0px)] at (-0.3) should be [rect(0px, 50px, 50px, 0px)]
+PASS CSS Transitions with transition: all: property <clip> from [auto] to [rect(0px, 50px, 50px, 0px)] at (0) should be [rect(0px, 50px, 50px, 0px)]
+PASS CSS Transitions with transition: all: property <clip> from [auto] to [rect(0px, 50px, 50px, 0px)] at (0.3) should be [rect(0px, 50px, 50px, 0px)]
+PASS CSS Transitions with transition: all: property <clip> from [auto] to [rect(0px, 50px, 50px, 0px)] at (0.5) should be [rect(0px, 50px, 50px, 0px)]
+PASS CSS Transitions with transition: all: property <clip> from [auto] to [rect(0px, 50px, 50px, 0px)] at (0.6) should be [rect(0px, 50px, 50px, 0px)]
+PASS CSS Transitions with transition: all: property <clip> from [auto] to [rect(0px, 50px, 50px, 0px)] at (1) should be [rect(0px, 50px, 50px, 0px)]
+PASS CSS Transitions with transition: all: property <clip> from [auto] to [rect(0px, 50px, 50px, 0px)] at (1.5) should be [rect(0px, 50px, 50px, 0px)]
+PASS CSS Animations: property <clip> from [auto] to [rect(0px, 50px, 50px, 0px)] at (-0.3) should be [auto]
+PASS CSS Animations: property <clip> from [auto] to [rect(0px, 50px, 50px, 0px)] at (0) should be [auto]
+PASS CSS Animations: property <clip> from [auto] to [rect(0px, 50px, 50px, 0px)] at (0.3) should be [auto]
+PASS CSS Animations: property <clip> from [auto] to [rect(0px, 50px, 50px, 0px)] at (0.5) should be [rect(0px, 50px, 50px, 0px)]
+PASS CSS Animations: property <clip> from [auto] to [rect(0px, 50px, 50px, 0px)] at (0.6) should be [rect(0px, 50px, 50px, 0px)]
+PASS CSS Animations: property <clip> from [auto] to [rect(0px, 50px, 50px, 0px)] at (1) should be [rect(0px, 50px, 50px, 0px)]
+PASS CSS Animations: property <clip> from [auto] to [rect(0px, 50px, 50px, 0px)] at (1.5) should be [rect(0px, 50px, 50px, 0px)]
+PASS Web Animations: property <clip> from [auto] to [rect(0px, 50px, 50px, 0px)] at (-0.3) should be [auto]
+PASS Web Animations: property <clip> from [auto] to [rect(0px, 50px, 50px, 0px)] at (0) should be [auto]
+PASS Web Animations: property <clip> from [auto] to [rect(0px, 50px, 50px, 0px)] at (0.3) should be [auto]
+PASS Web Animations: property <clip> from [auto] to [rect(0px, 50px, 50px, 0px)] at (0.5) should be [rect(0px, 50px, 50px, 0px)]
+PASS Web Animations: property <clip> from [auto] to [rect(0px, 50px, 50px, 0px)] at (0.6) should be [rect(0px, 50px, 50px, 0px)]
+PASS Web Animations: property <clip> from [auto] to [rect(0px, 50px, 50px, 0px)] at (1) should be [rect(0px, 50px, 50px, 0px)]
+PASS Web Animations: property <clip> from [auto] to [rect(0px, 50px, 50px, 0px)] at (1.5) should be [rect(0px, 50px, 50px, 0px)]
+PASS CSS Transitions: property <clip> from [rect(0px, 50px, 50px, 0px)] to [auto] at (-0.3) should be [auto]
+PASS CSS Transitions: property <clip> from [rect(0px, 50px, 50px, 0px)] to [auto] at (0) should be [auto]
+PASS CSS Transitions: property <clip> from [rect(0px, 50px, 50px, 0px)] to [auto] at (0.3) should be [auto]
+PASS CSS Transitions: property <clip> from [rect(0px, 50px, 50px, 0px)] to [auto] at (0.5) should be [auto]
+PASS CSS Transitions: property <clip> from [rect(0px, 50px, 50px, 0px)] to [auto] at (0.6) should be [auto]
+PASS CSS Transitions: property <clip> from [rect(0px, 50px, 50px, 0px)] to [auto] at (1) should be [auto]
+PASS CSS Transitions: property <clip> from [rect(0px, 50px, 50px, 0px)] to [auto] at (1.5) should be [auto]
+PASS CSS Transitions with transition: all: property <clip> from [rect(0px, 50px, 50px, 0px)] to [auto] at (-0.3) should be [auto]
+PASS CSS Transitions with transition: all: property <clip> from [rect(0px, 50px, 50px, 0px)] to [auto] at (0) should be [auto]
+PASS CSS Transitions with transition: all: property <clip> from [rect(0px, 50px, 50px, 0px)] to [auto] at (0.3) should be [auto]
+PASS CSS Transitions with transition: all: property <clip> from [rect(0px, 50px, 50px, 0px)] to [auto] at (0.5) should be [auto]
+PASS CSS Transitions with transition: all: property <clip> from [rect(0px, 50px, 50px, 0px)] to [auto] at (0.6) should be [auto]
+PASS CSS Transitions with transition: all: property <clip> from [rect(0px, 50px, 50px, 0px)] to [auto] at (1) should be [auto]
+PASS CSS Transitions with transition: all: property <clip> from [rect(0px, 50px, 50px, 0px)] to [auto] at (1.5) should be [auto]
+PASS CSS Animations: property <clip> from [rect(0px, 50px, 50px, 0px)] to [auto] at (-0.3) should be [rect(0px, 50px, 50px, 0px)]
+PASS CSS Animations: property <clip> from [rect(0px, 50px, 50px, 0px)] to [auto] at (0) should be [rect(0px, 50px, 50px, 0px)]
+PASS CSS Animations: property <clip> from [rect(0px, 50px, 50px, 0px)] to [auto] at (0.3) should be [rect(0px, 50px, 50px, 0px)]
+PASS CSS Animations: property <clip> from [rect(0px, 50px, 50px, 0px)] to [auto] at (0.5) should be [auto]
+PASS CSS Animations: property <clip> from [rect(0px, 50px, 50px, 0px)] to [auto] at (0.6) should be [auto]
+PASS CSS Animations: property <clip> from [rect(0px, 50px, 50px, 0px)] to [auto] at (1) should be [auto]
+PASS CSS Animations: property <clip> from [rect(0px, 50px, 50px, 0px)] to [auto] at (1.5) should be [auto]
+PASS Web Animations: property <clip> from [rect(0px, 50px, 50px, 0px)] to [auto] at (-0.3) should be [rect(0px, 50px, 50px, 0px)]
+PASS Web Animations: property <clip> from [rect(0px, 50px, 50px, 0px)] to [auto] at (0) should be [rect(0px, 50px, 50px, 0px)]
+PASS Web Animations: property <clip> from [rect(0px, 50px, 50px, 0px)] to [auto] at (0.3) should be [rect(0px, 50px, 50px, 0px)]
+PASS Web Animations: property <clip> from [rect(0px, 50px, 50px, 0px)] to [auto] at (0.5) should be [auto]
+PASS Web Animations: property <clip> from [rect(0px, 50px, 50px, 0px)] to [auto] at (0.6) should be [auto]
+PASS Web Animations: property <clip> from [rect(0px, 50px, 50px, 0px)] to [auto] at (1) should be [auto]
+PASS Web Animations: property <clip> from [rect(0px, 50px, 50px, 0px)] to [auto] at (1.5) should be [auto]
+

Added: trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-masking/animations/clip-interpolation.html (0 => 274391)


--- trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-masking/animations/clip-interpolation.html	                        (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-masking/animations/clip-interpolation.html	2021-03-13 20:00:21 UTC (rev 274391)
@@ -0,0 +1,117 @@
+<!DOCTYPE html>
+<meta charset="UTF-8">
+<title>clip interpolation</title>
+<link rel="help" href=""
+<meta name="assert" content="clip supports animation">
+
+<script src=""
+<script src=""
+<script src=""
+
+<style>
+.container {
+  width: 80px;
+  height: 80px;
+  background: black;
+  display: inline-block;
+  padding: 5px;
+}
+
+.container:nth-child(2n) {
+  background: green;
+}
+
+.parent {
+  clip: rect(100px, 0px, 100px, 0px);
+}
+
+.target {
+  width: 80px;
+  height: 80px;
+  display: inline-block;
+  position: absolute;
+  background: white;
+  clip: rect(0px, 100px, 0px, 100px);
+}
+</style>
+
+<body>
+<template id="target-template">
+<div class="container"><div class="target"></div></div>
+</template>
+<script>
+test_interpolation({
+  property: 'clip',
+  from: neutralKeyframe,
+  to: 'rect(20px, 20px, 20px, 20px)',
+}, [
+  {at: -1, expect: 'rect(-20px 180px -20px 180px)'},
+  {at: 0, expect: 'rect(0px 100px 0px 100px)'},
+  {at: 0.25, expect: 'rect(5px 80px 5px 80px)'},
+  {at: 0.75, expect: 'rect(15px 40px 15px 40px)'},
+  {at: 1, expect: 'rect(20px 20px 20px 20px)'},
+  {at: 2, expect: 'rect(40px -60px 40px -60px)'},
+]);
+
+test_no_interpolation({
+  property: 'clip',
+  from: 'initial',
+  to: 'rect(20px, 20px, 20px, 20px)',
+});
+
+test_interpolation({
+  property: 'clip',
+  from: 'inherit',
+  to: 'rect(20px, 20px, 20px, 20px)',
+}, [
+  {at: -1, expect: 'rect(180px -20px 180px -20px)'},
+  {at: 0, expect: 'rect(100px 0px 100px 0px)'},
+  {at: 0.25, expect: 'rect(80px 5px 80px 5px)'},
+  {at: 0.75, expect: 'rect(40px 15px 40px 15px)'},
+  {at: 1, expect: 'rect(20px 20px 20px 20px)'},
+  {at: 2, expect: 'rect(-60px 40px -60px 40px)'},
+]);
+
+test_no_interpolation({
+  property: 'clip',
+  from: 'unset',
+  to: 'rect(20px, 20px, 20px, 20px)',
+});
+
+test_interpolation({
+  property: 'clip',
+  from: 'rect(0px, 75px, 80px, 10px)',
+  to: 'rect(0px, 100px, 90px, 5px)'
+}, [
+  {at: -1, expect: 'rect(0px, 50px, 70px, 15px)'},
+  {at: 0, expect: 'rect(0px, 75px, 80px, 10px)'},
+  {at: 0.25, expect: 'rect(0px, 81.25px, 82.5px, 8.75px)'},
+  {at: 0.75, expect: 'rect(0px, 93.75px, 87.5px, 6.25px)'},
+  {at: 1, expect: 'rect(0px, 100px, 90px, 5px)'},
+  {at: 2, expect: 'rect(0px, 125px, 100px, 0px)'},
+]);
+
+test_no_interpolation({
+  property: 'clip',
+  from: 'rect(auto, auto, auto, 10px)',
+  to: 'rect(20px, 50px, 50px, auto)'
+});
+
+test_no_interpolation({
+  property: 'clip',
+  from: 'rect(auto, 0px, auto, 10px)',
+  to: 'rect(auto, 50px, 50px, auto)'
+});
+
+test_no_interpolation({
+  property: 'clip',
+  from: 'auto',
+  to: 'rect(0px, 50px, 50px, 0px)'
+});
+
+test_no_interpolation({
+  property: 'clip',
+  from: 'rect(0px, 50px, 50px, 0px)',
+  to: 'auto'
+});
+</script>

Modified: trunk/Source/WebCore/ChangeLog (274390 => 274391)


--- trunk/Source/WebCore/ChangeLog	2021-03-13 19:08:22 UTC (rev 274390)
+++ trunk/Source/WebCore/ChangeLog	2021-03-13 20:00:21 UTC (rev 274391)
@@ -1,3 +1,24 @@
+2021-03-13  Antoine Quint  <[email protected]>
+
+        Fix interpolation of clip CSS property
+        https://bugs.webkit.org/show_bug.cgi?id=223126
+
+        Reviewed by Antti Koivisto.
+
+        Test: imported/w3c/web-platform-tests/css/css-masking/animations/clip-interpolation.html
+
+        While we already had support for interpolating the clip property, we had a couple of small
+        issues to fix to pass the entire WPT test dedicated to testing that feature:
+
+            1. we must allow negative values
+            2. we must serialize the value to "auto" if all four values are "auto"
+
+        * animation/CSSPropertyAnimation.cpp:
+        (WebCore::blendFunc):
+        (WebCore::CSSPropertyAnimationWrapperMap::CSSPropertyAnimationWrapperMap):
+        * css/CSSComputedStyleDeclaration.cpp:
+        (WebCore::ComputedStyleExtractor::valueForPropertyInStyle):
+
 2021-03-13  Peng Liu  <[email protected]>
 
         [GPUP][MSE] MediaSource::buffered and MediaSource::activeSourceBuffers do not update in the same run loop as MediaSource::endOfStream()

Modified: trunk/Source/WebCore/animation/CSSPropertyAnimation.cpp (274390 => 274391)


--- trunk/Source/WebCore/animation/CSSPropertyAnimation.cpp	2021-03-13 19:08:22 UTC (rev 274390)
+++ trunk/Source/WebCore/animation/CSSPropertyAnimation.cpp	2021-03-13 20:00:21 UTC (rev 274391)
@@ -386,12 +386,12 @@
     return TextDecorationThickness::createWithAuto();
 }
 
-static inline LengthBox blendFunc(const CSSPropertyBlendingClient* anim, const LengthBox& from, const LengthBox& to, double progress)
+static inline LengthBox blendFunc(const CSSPropertyBlendingClient* anim, const LengthBox& from, const LengthBox& to, double progress, ValueRange valueRange = ValueRangeNonNegative)
 {
-    LengthBox result(blendFunc(anim, from.top(), to.top(), progress, ValueRangeNonNegative),
-                     blendFunc(anim, from.right(), to.right(), progress, ValueRangeNonNegative),
-                     blendFunc(anim, from.bottom(), to.bottom(), progress, ValueRangeNonNegative),
-                     blendFunc(anim, from.left(), to.left(), progress, ValueRangeNonNegative));
+    LengthBox result(blendFunc(anim, from.top(), to.top(), progress, valueRange),
+                     blendFunc(anim, from.right(), to.right(), progress, valueRange),
+                     blendFunc(anim, from.bottom(), to.bottom(), progress, valueRange),
+                     blendFunc(anim, from.left(), to.left(), progress, valueRange));
 
     return result;
 }
@@ -790,8 +790,9 @@
     WTF_MAKE_FAST_ALLOCATED;
 public:
     enum class Flags {
-        IsLengthPercentage  = 1 << 0,
-        UsesFillKeyword     = 1 << 1,
+        IsLengthPercentage      = 1 << 0,
+        UsesFillKeyword         = 1 << 1,
+        AllowsNegativeValues    = 1 << 2,
     };
     LengthBoxPropertyWrapper(CSSPropertyID prop, const LengthBox& (RenderStyle::*getter)() const, void (RenderStyle::*setter)(LengthBox&&), OptionSet<Flags> flags = { })
         : PropertyWrapperGetter<const LengthBox&>(prop, getter)
@@ -818,7 +819,8 @@
     {
         if (m_flags.contains(Flags::UsesFillKeyword))
             dst->setBorderImageSliceFill((!progress || canInterpolate(a, b) ? a : b)->borderImage().fill());
-        (dst->*m_setter)(blendFunc(anim, this->value(a), this->value(b), progress));
+        auto valueRange = m_flags.contains(Flags::AllowsNegativeValues) ? ValueRangeAll : ValueRangeNonNegative;
+        (dst->*m_setter)(blendFunc(anim, this->value(a), this->value(b), progress, valueRange));
     }
 
 protected:
@@ -1986,7 +1988,7 @@
         new PropertyWrapper<Visibility>(CSSPropertyVisibility, &RenderStyle::visibility, &RenderStyle::setVisibility),
         new PropertyWrapper<float>(CSSPropertyZoom, &RenderStyle::zoom, &RenderStyle::setZoomWithoutReturnValue),
 
-        new LengthBoxPropertyWrapper(CSSPropertyClip, &RenderStyle::clip, &RenderStyle::setClip),
+        new LengthBoxPropertyWrapper(CSSPropertyClip, &RenderStyle::clip, &RenderStyle::setClip, { LengthBoxPropertyWrapper::Flags::AllowsNegativeValues }),
 
         new AcceleratedPropertyWrapper<float>(CSSPropertyOpacity, &RenderStyle::opacity, &RenderStyle::setOpacity),
         new AcceleratedPropertyWrapper<const TransformOperations&>(CSSPropertyTransform, &RenderStyle::transform, &RenderStyle::setTransform),

Modified: trunk/Source/WebCore/css/CSSComputedStyleDeclaration.cpp (274390 => 274391)


--- trunk/Source/WebCore/css/CSSComputedStyleDeclaration.cpp	2021-03-13 19:08:22 UTC (rev 274390)
+++ trunk/Source/WebCore/css/CSSComputedStyleDeclaration.cpp	2021-03-13 20:00:21 UTC (rev 274391)
@@ -3578,6 +3578,10 @@
         case CSSPropertyClip: {
             if (!style.hasClip())
                 return cssValuePool.createIdentifierValue(CSSValueAuto);
+            if (style.clip().top().isAuto() && style.clip().right().isAuto()
+                && style.clip().top().isAuto() && style.clip().right().isAuto())
+                return cssValuePool.createIdentifierValue(CSSValueAuto);
+
             auto rect = Rect::create();
             rect->setTop(autoOrZoomAdjustedValue(style.clip().top(), style));
             rect->setRight(autoOrZoomAdjustedValue(style.clip().right(), style));
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to