Title: [280721] trunk
Revision
280721
Author
[email protected]
Date
2021-08-06 06:42:59 -0700 (Fri, 06 Aug 2021)

Log Message

REGRESSION (r274038): Keyframe animation with top/left with percentages fails to animate
https://bugs.webkit.org/show_bug.cgi?id=228811
<rdar://problem/81568266>

Reviewed by Alan Bujtas.

LayoutTests/imported/w3c:

* web-platform-tests/css/css-position/animations/bottom-composition-expected.txt:
* web-platform-tests/css/css-position/animations/left-composition-expected.txt:
* web-platform-tests/css/css-position/animations/right-composition-expected.txt:
* web-platform-tests/css/css-position/animations/top-composition-expected.txt:

Source/WebCore:

r274038 ended up disabling interpolation of percent values for top/left/bottom/right.

Test: animations/top-left-percent-interpolation.html

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

Enable them.

LayoutTests:

* animations/top-left-percent-interpolation-expected.txt: Added.
* animations/top-left-percent-interpolation.html: Added.

Modified Paths

Added Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (280720 => 280721)


--- trunk/LayoutTests/ChangeLog	2021-08-06 09:15:49 UTC (rev 280720)
+++ trunk/LayoutTests/ChangeLog	2021-08-06 13:42:59 UTC (rev 280721)
@@ -1,3 +1,14 @@
+2021-08-06  Antti Koivisto  <[email protected]>
+
+        REGRESSION (r274038): Keyframe animation with top/left with percentages fails to animate
+        https://bugs.webkit.org/show_bug.cgi?id=228811
+        <rdar://problem/81568266>
+
+        Reviewed by Alan Bujtas.
+
+        * animations/top-left-percent-interpolation-expected.txt: Added.
+        * animations/top-left-percent-interpolation.html: Added.
+
 2021-08-06  Youenn Fablet  <[email protected]>
 
         MediaPlayerPrivateMediaStreamAVFObjC should skip enqueuing frames when not visible

Added: trunk/LayoutTests/animations/top-left-percent-interpolation-expected.txt (0 => 280721)


--- trunk/LayoutTests/animations/top-left-percent-interpolation-expected.txt	                        (rev 0)
+++ trunk/LayoutTests/animations/top-left-percent-interpolation-expected.txt	2021-08-06 13:42:59 UTC (rev 280721)
@@ -0,0 +1,5 @@
+PASS - "left" property for "box1" element at 0.5s saw something close to: 100
+PASS - "top" property for "box1" element at 0.5s saw something close to: 100
+PASS - "right" property for "box2" element at 0.5s saw something close to: 100
+PASS - "bottom" property for "box2" element at 0.5s saw something close to: 100
+

Added: trunk/LayoutTests/animations/top-left-percent-interpolation.html (0 => 280721)


--- trunk/LayoutTests/animations/top-left-percent-interpolation.html	                        (rev 0)
+++ trunk/LayoutTests/animations/top-left-percent-interpolation.html	2021-08-06 13:42:59 UTC (rev 280721)
@@ -0,0 +1,62 @@
+<style>
+#container {
+  border: 2px solid blue;
+  width:200px;
+  height:200px;
+  position:relative;
+}
+
+#box1 {
+  position: absolute;
+  top: 0;
+  left: 0;
+  width: 100px;
+  height: 100px;
+  background: blue;
+
+  animation: top-left 1s linear;
+}
+
+#box2 {
+  position: absolute;
+  bottom: 0;
+  right: 0;
+  width: 100px;
+  height: 100px;
+  background: green;
+
+  animation: bottom-right 1s linear;
+}
+
+@keyframes top-left {
+  100% {
+     top: 100%;
+     left: 100%;
+  }
+}
+@keyframes bottom-right {
+  100% {
+     bottom: 100%;
+     right: 100%;
+  }
+}
+</style>
+<script src=""
+<script>
+
+const expectedValues = [
+    // [animation-name, time, element-id, property, expected-value, tolerance]
+    ["top-left", 0.5, "box1", "left", 100, 20],
+    ["top-left", 0.5, "box1", "top", 100, 20],
+    ["bottom-right", 0.5, "box2", "right", 100, 20],
+    ["bottom-right", 0.5, "box2", "bottom", 100, 20],
+];
+
+runAnimationTest(expectedValues);
+</script>
+<div id="container">
+  <div id="box1"></div>
+  <div id="box2"></div>
+</div>
+<div id="result">
+</div>

Modified: trunk/LayoutTests/imported/w3c/ChangeLog (280720 => 280721)


--- trunk/LayoutTests/imported/w3c/ChangeLog	2021-08-06 09:15:49 UTC (rev 280720)
+++ trunk/LayoutTests/imported/w3c/ChangeLog	2021-08-06 13:42:59 UTC (rev 280721)
@@ -1,3 +1,16 @@
+2021-08-06  Antti Koivisto  <[email protected]>
+
+        REGRESSION (r274038): Keyframe animation with top/left with percentages fails to animate
+        https://bugs.webkit.org/show_bug.cgi?id=228811
+        <rdar://problem/81568266>
+
+        Reviewed by Alan Bujtas.
+
+        * web-platform-tests/css/css-position/animations/bottom-composition-expected.txt:
+        * web-platform-tests/css/css-position/animations/left-composition-expected.txt:
+        * web-platform-tests/css/css-position/animations/right-composition-expected.txt:
+        * web-platform-tests/css/css-position/animations/top-composition-expected.txt:
+
 2021-08-05  Tim Nguyen  <[email protected]>
 
         Implement support for <dialog> element cancel event

Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-position/animations/bottom-composition-expected.txt (280720 => 280721)


--- trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-position/animations/bottom-composition-expected.txt	2021-08-06 09:15:49 UTC (rev 280720)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-position/animations/bottom-composition-expected.txt	2021-08-06 13:42:59 UTC (rev 280721)
@@ -9,11 +9,11 @@
 FAIL Compositing: property <bottom> underlying [100px] from add [10px] to add [2px] at (0.5) should be [106px] assert_equals: expected "106px " but got "6px "
 FAIL Compositing: property <bottom> underlying [100px] from add [10px] to add [2px] at (1) should be [102px] assert_equals: expected "102px " but got "2px "
 FAIL Compositing: property <bottom> underlying [100px] from add [10px] to add [2px] at (1.5) should be [98px] assert_equals: expected "98px " but got "- 2px "
-FAIL Compositing: property <bottom> underlying [10%] from add [100px] to add [20%] at (-0.3) should be [calc(130px + 4%)] assert_equals: expected "calc ( 4 % + 130px ) " but got "calc ( 0 % + 100px ) "
+FAIL Compositing: property <bottom> underlying [10%] from add [100px] to add [20%] at (-0.3) should be [calc(130px + 4%)] assert_equals: expected "calc ( 4 % + 130px ) " but got "calc ( - 6 % + 130px ) "
 FAIL Compositing: property <bottom> underlying [10%] from add [100px] to add [20%] at (0) should be [calc(100px + 10%)] assert_equals: expected "calc ( 10 % + 100px ) " but got "calc ( 0 % + 100px ) "
-FAIL Compositing: property <bottom> underlying [10%] from add [100px] to add [20%] at (0.5) should be [calc(50px + 20%)] assert_equals: expected "calc ( 20 % + 50px ) " but got "20 % "
+FAIL Compositing: property <bottom> underlying [10%] from add [100px] to add [20%] at (0.5) should be [calc(50px + 20%)] assert_equals: expected "calc ( 20 % + 50px ) " but got "calc ( 10 % + 50px ) "
 FAIL Compositing: property <bottom> underlying [10%] from add [100px] to add [20%] at (1) should be [30%] assert_equals: expected "30 % " but got "20 % "
-FAIL Compositing: property <bottom> underlying [10%] from add [100px] to add [20%] at (1.5) should be [calc(-50px + 40%)] assert_equals: expected "calc ( 40 % - 50px ) " but got "20 % "
+FAIL Compositing: property <bottom> underlying [10%] from add [100px] to add [20%] at (1.5) should be [calc(-50px + 40%)] assert_equals: expected "calc ( 40 % - 50px ) " but got "calc ( 30 % - 50px ) "
 FAIL Compositing: property <bottom> underlying [50px] from add [100px] to replace [200px] at (-0.3) should be [135px] assert_equals: expected "135px " but got "70px "
 FAIL Compositing: property <bottom> underlying [50px] from add [100px] to replace [200px] at (0) should be [150px] assert_equals: expected "150px " but got "100px "
 FAIL Compositing: property <bottom> underlying [50px] from add [100px] to replace [200px] at (0.5) should be [175px] assert_equals: expected "175px " but got "150px "

Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-position/animations/left-composition-expected.txt (280720 => 280721)


--- trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-position/animations/left-composition-expected.txt	2021-08-06 09:15:49 UTC (rev 280720)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-position/animations/left-composition-expected.txt	2021-08-06 13:42:59 UTC (rev 280721)
@@ -9,16 +9,16 @@
 FAIL Compositing: property <left> underlying [100px] from add [10px] to add [2px] at (0.5) should be [106px] assert_equals: expected "106px " but got "6px "
 FAIL Compositing: property <left> underlying [100px] from add [10px] to add [2px] at (1) should be [102px] assert_equals: expected "102px " but got "2px "
 FAIL Compositing: property <left> underlying [100px] from add [10px] to add [2px] at (1.5) should be [98px] assert_equals: expected "98px " but got "- 2px "
-FAIL Compositing: property <left> underlying [10%] from add [100px] to add [20%] at (-0.3) should be [calc(130px + 4%)] assert_equals: expected "calc ( 4 % + 130px ) " but got "calc ( 0 % + 100px ) "
+FAIL Compositing: property <left> underlying [10%] from add [100px] to add [20%] at (-0.3) should be [calc(130px + 4%)] assert_equals: expected "calc ( 4 % + 130px ) " but got "calc ( - 6 % + 130px ) "
 FAIL Compositing: property <left> underlying [10%] from add [100px] to add [20%] at (0) should be [calc(100px + 10%)] assert_equals: expected "calc ( 10 % + 100px ) " but got "calc ( 0 % + 100px ) "
-FAIL Compositing: property <left> underlying [10%] from add [100px] to add [20%] at (0.5) should be [calc(50px + 20%)] assert_equals: expected "calc ( 20 % + 50px ) " but got "20 % "
+FAIL Compositing: property <left> underlying [10%] from add [100px] to add [20%] at (0.5) should be [calc(50px + 20%)] assert_equals: expected "calc ( 20 % + 50px ) " but got "calc ( 10 % + 50px ) "
 FAIL Compositing: property <left> underlying [10%] from add [100px] to add [20%] at (1) should be [30%] assert_equals: expected "30 % " but got "20 % "
-FAIL Compositing: property <left> underlying [10%] from add [100px] to add [20%] at (1.5) should be [calc(-50px + 40%)] assert_equals: expected "calc ( 40 % - 50px ) " but got "20 % "
-FAIL Compositing: property <left> underlying [10%] from add [100px] to add [-10%] at (-0.3) should be [calc(130px + 13%)] assert_equals: expected "calc ( 13 % + 130px ) " but got "calc ( 0 % + 100px ) "
+FAIL Compositing: property <left> underlying [10%] from add [100px] to add [20%] at (1.5) should be [calc(-50px + 40%)] assert_equals: expected "calc ( 40 % - 50px ) " but got "calc ( 30 % - 50px ) "
+FAIL Compositing: property <left> underlying [10%] from add [100px] to add [-10%] at (-0.3) should be [calc(130px + 13%)] assert_equals: expected "calc ( 13 % + 130px ) " but got "calc ( 3 % + 130px ) "
 FAIL Compositing: property <left> underlying [10%] from add [100px] to add [-10%] at (0) should be [calc(100px + 10%)] assert_equals: expected "calc ( 10 % + 100px ) " but got "calc ( 0 % + 100px ) "
-FAIL Compositing: property <left> underlying [10%] from add [100px] to add [-10%] at (0.5) should be [calc(50px + 5%)] assert_equals: expected "calc ( 5 % + 50px ) " but got "- 10 % "
+FAIL Compositing: property <left> underlying [10%] from add [100px] to add [-10%] at (0.5) should be [calc(50px + 5%)] assert_equals: expected "calc ( 5 % + 50px ) " but got "calc ( - 5 % + 50px ) "
 FAIL Compositing: property <left> underlying [10%] from add [100px] to add [-10%] at (1) should be [0%] assert_equals: expected "0 % " but got "- 10 % "
-FAIL Compositing: property <left> underlying [10%] from add [100px] to add [-10%] at (1.5) should be [calc(-50px - 5%)] assert_equals: expected "calc ( - 5 % - 50px ) " but got "- 10 % "
+FAIL Compositing: property <left> underlying [10%] from add [100px] to add [-10%] at (1.5) should be [calc(-50px - 5%)] assert_equals: expected "calc ( - 5 % - 50px ) " but got "calc ( - 15 % - 50px ) "
 FAIL Compositing: property <left> underlying [50px] from add [100px] to replace [200px] at (-0.3) should be [135px] assert_equals: expected "135px " but got "70px "
 FAIL Compositing: property <left> underlying [50px] from add [100px] to replace [200px] at (0) should be [150px] assert_equals: expected "150px " but got "100px "
 FAIL Compositing: property <left> underlying [50px] from add [100px] to replace [200px] at (0.5) should be [175px] assert_equals: expected "175px " but got "150px "

Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-position/animations/right-composition-expected.txt (280720 => 280721)


--- trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-position/animations/right-composition-expected.txt	2021-08-06 09:15:49 UTC (rev 280720)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-position/animations/right-composition-expected.txt	2021-08-06 13:42:59 UTC (rev 280721)
@@ -9,11 +9,11 @@
 FAIL Compositing: property <right> underlying [100px] from add [10px] to add [2px] at (0.5) should be [106px] assert_equals: expected "106px " but got "6px "
 FAIL Compositing: property <right> underlying [100px] from add [10px] to add [2px] at (1) should be [102px] assert_equals: expected "102px " but got "2px "
 FAIL Compositing: property <right> underlying [100px] from add [10px] to add [2px] at (1.5) should be [98px] assert_equals: expected "98px " but got "- 2px "
-FAIL Compositing: property <right> underlying [10%] from add [100px] to add [20%] at (-0.3) should be [calc(130px + 4%)] assert_equals: expected "calc ( 4 % + 130px ) " but got "calc ( 0 % + 100px ) "
+FAIL Compositing: property <right> underlying [10%] from add [100px] to add [20%] at (-0.3) should be [calc(130px + 4%)] assert_equals: expected "calc ( 4 % + 130px ) " but got "calc ( - 6 % + 130px ) "
 FAIL Compositing: property <right> underlying [10%] from add [100px] to add [20%] at (0) should be [calc(100px + 10%)] assert_equals: expected "calc ( 10 % + 100px ) " but got "calc ( 0 % + 100px ) "
-FAIL Compositing: property <right> underlying [10%] from add [100px] to add [20%] at (0.5) should be [calc(50px + 20%)] assert_equals: expected "calc ( 20 % + 50px ) " but got "20 % "
+FAIL Compositing: property <right> underlying [10%] from add [100px] to add [20%] at (0.5) should be [calc(50px + 20%)] assert_equals: expected "calc ( 20 % + 50px ) " but got "calc ( 10 % + 50px ) "
 FAIL Compositing: property <right> underlying [10%] from add [100px] to add [20%] at (1) should be [30%] assert_equals: expected "30 % " but got "20 % "
-FAIL Compositing: property <right> underlying [10%] from add [100px] to add [20%] at (1.5) should be [calc(-50px + 40%)] assert_equals: expected "calc ( 40 % - 50px ) " but got "20 % "
+FAIL Compositing: property <right> underlying [10%] from add [100px] to add [20%] at (1.5) should be [calc(-50px + 40%)] assert_equals: expected "calc ( 40 % - 50px ) " but got "calc ( 30 % - 50px ) "
 FAIL Compositing: property <right> underlying [50px] from add [100px] to replace [200px] at (-0.3) should be [135px] assert_equals: expected "135px " but got "70px "
 FAIL Compositing: property <right> underlying [50px] from add [100px] to replace [200px] at (0) should be [150px] assert_equals: expected "150px " but got "100px "
 FAIL Compositing: property <right> underlying [50px] from add [100px] to replace [200px] at (0.5) should be [175px] assert_equals: expected "175px " but got "150px "

Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-position/animations/top-composition-expected.txt (280720 => 280721)


--- trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-position/animations/top-composition-expected.txt	2021-08-06 09:15:49 UTC (rev 280720)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-position/animations/top-composition-expected.txt	2021-08-06 13:42:59 UTC (rev 280721)
@@ -9,11 +9,11 @@
 FAIL Compositing: property <top> underlying [100px] from add [10px] to add [2px] at (0.5) should be [106px] assert_equals: expected "106px " but got "6px "
 FAIL Compositing: property <top> underlying [100px] from add [10px] to add [2px] at (1) should be [102px] assert_equals: expected "102px " but got "2px "
 FAIL Compositing: property <top> underlying [100px] from add [10px] to add [2px] at (1.5) should be [98px] assert_equals: expected "98px " but got "- 2px "
-FAIL Compositing: property <top> underlying [10%] from add [100px] to add [20%] at (-0.3) should be [calc(130px + 4%)] assert_equals: expected "calc ( 4 % + 130px ) " but got "calc ( 0 % + 100px ) "
+FAIL Compositing: property <top> underlying [10%] from add [100px] to add [20%] at (-0.3) should be [calc(130px + 4%)] assert_equals: expected "calc ( 4 % + 130px ) " but got "calc ( - 6 % + 130px ) "
 FAIL Compositing: property <top> underlying [10%] from add [100px] to add [20%] at (0) should be [calc(100px + 10%)] assert_equals: expected "calc ( 10 % + 100px ) " but got "calc ( 0 % + 100px ) "
-FAIL Compositing: property <top> underlying [10%] from add [100px] to add [20%] at (0.5) should be [calc(50px + 20%)] assert_equals: expected "calc ( 20 % + 50px ) " but got "20 % "
+FAIL Compositing: property <top> underlying [10%] from add [100px] to add [20%] at (0.5) should be [calc(50px + 20%)] assert_equals: expected "calc ( 20 % + 50px ) " but got "calc ( 10 % + 50px ) "
 FAIL Compositing: property <top> underlying [10%] from add [100px] to add [20%] at (1) should be [30%] assert_equals: expected "30 % " but got "20 % "
-FAIL Compositing: property <top> underlying [10%] from add [100px] to add [20%] at (1.5) should be [calc(-50px + 40%)] assert_equals: expected "calc ( 40 % - 50px ) " but got "20 % "
+FAIL Compositing: property <top> underlying [10%] from add [100px] to add [20%] at (1.5) should be [calc(-50px + 40%)] assert_equals: expected "calc ( 40 % - 50px ) " but got "calc ( 30 % - 50px ) "
 FAIL Compositing: property <top> underlying [50px] from add [100px] to replace [200px] at (-0.3) should be [135px] assert_equals: expected "135px " but got "70px "
 FAIL Compositing: property <top> underlying [50px] from add [100px] to replace [200px] at (0) should be [150px] assert_equals: expected "150px " but got "100px "
 FAIL Compositing: property <top> underlying [50px] from add [100px] to replace [200px] at (0.5) should be [175px] assert_equals: expected "175px " but got "150px "

Modified: trunk/Source/WebCore/ChangeLog (280720 => 280721)


--- trunk/Source/WebCore/ChangeLog	2021-08-06 09:15:49 UTC (rev 280720)
+++ trunk/Source/WebCore/ChangeLog	2021-08-06 13:42:59 UTC (rev 280721)
@@ -1,3 +1,20 @@
+2021-08-06  Antti Koivisto  <[email protected]>
+
+        REGRESSION (r274038): Keyframe animation with top/left with percentages fails to animate
+        https://bugs.webkit.org/show_bug.cgi?id=228811
+        <rdar://problem/81568266>
+
+        Reviewed by Alan Bujtas.
+
+        r274038 ended up disabling interpolation of percent values for top/left/bottom/right.
+
+        Test: animations/top-left-percent-interpolation.html
+
+        * animation/CSSPropertyAnimation.cpp:
+        (WebCore::CSSPropertyAnimationWrapperMap::CSSPropertyAnimationWrapperMap):
+
+        Enable them.
+
 2021-08-06  Youenn Fablet  <[email protected]>
 
         MediaPlayerPrivateMediaStreamAVFObjC should skip enqueuing frames when not visible

Modified: trunk/Source/WebCore/animation/CSSPropertyAnimation.cpp (280720 => 280721)


--- trunk/Source/WebCore/animation/CSSPropertyAnimation.cpp	2021-08-06 09:15:49 UTC (rev 280720)
+++ trunk/Source/WebCore/animation/CSSPropertyAnimation.cpp	2021-08-06 13:42:59 UTC (rev 280721)
@@ -2279,10 +2279,10 @@
 {
     // build the list of property wrappers to do the comparisons and blends
     AnimationPropertyWrapperBase* animatableLonghandPropertyWrappers[] = {
-        new LengthPropertyWrapper(CSSPropertyLeft, &RenderStyle::left, &RenderStyle::setLeft),
-        new LengthPropertyWrapper(CSSPropertyRight, &RenderStyle::right, &RenderStyle::setRight),
-        new LengthPropertyWrapper(CSSPropertyTop, &RenderStyle::top, &RenderStyle::setTop),
-        new LengthPropertyWrapper(CSSPropertyBottom, &RenderStyle::bottom, &RenderStyle::setBottom),
+        new LengthPropertyWrapper(CSSPropertyLeft, &RenderStyle::left, &RenderStyle::setLeft, { LengthPropertyWrapper::Flags::IsLengthPercentage }),
+        new LengthPropertyWrapper(CSSPropertyRight, &RenderStyle::right, &RenderStyle::setRight, { LengthPropertyWrapper::Flags::IsLengthPercentage }),
+        new LengthPropertyWrapper(CSSPropertyTop, &RenderStyle::top, &RenderStyle::setTop, { LengthPropertyWrapper::Flags::IsLengthPercentage }),
+        new LengthPropertyWrapper(CSSPropertyBottom, &RenderStyle::bottom, &RenderStyle::setBottom, { LengthPropertyWrapper::Flags::IsLengthPercentage }),
 
         new LengthPropertyWrapper(CSSPropertyWidth, &RenderStyle::width, &RenderStyle::setWidth, { LengthPropertyWrapper::Flags::IsLengthPercentage, LengthPropertyWrapper::Flags::NegativeLengthsAreInvalid }),
         new LengthPropertyWrapper(CSSPropertyMinWidth, &RenderStyle::minWidth, &RenderStyle::setMinWidth, { LengthPropertyWrapper::Flags::IsLengthPercentage, LengthPropertyWrapper::Flags::NegativeLengthsAreInvalid }),
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to