Title: [282315] trunk
Revision
282315
Author
[email protected]
Date
2021-09-11 18:41:08 -0700 (Sat, 11 Sep 2021)

Log Message

css/css-transforms/translate-getComputedStyle.html fails
https://bugs.webkit.org/show_bug.cgi?id=230178

Reviewed by Antti Koivisto.

LayoutTests/imported/w3c:

The interpolation test appears to regress, but do so because we now correctly output calc()
in computed style (we just serialize the calc incorrectly).

* web-platform-tests/css/css-transforms/animation/translate-composition-expected.txt:
* web-platform-tests/css/css-transforms/animation/translate-interpolation-expected.txt:
* web-platform-tests/css/css-transforms/transforms-support-calc-expected.txt:
* web-platform-tests/css/css-transforms/translate-getComputedStyle-expected.txt:
* web-platform-tests/web-animations/animation-model/animation-types/interpolation-per-property-002-expected.txt:

Source/WebCore:

https://drafts.csswg.org/css-transforms-2/#propdef-translate says that the computed value of
the translate property is "the keyword none or a pair of computed <length-percentage> values
and an absolute length" and has a note saying "Note: The resolved value of the translate
property is the computed value, and thus getComputedStyle() includes percentage values in
its results." so implement that.

Tested by imported/w3c/web-platform-tests/css/css-transforms/translate-getComputedStyle.html

* css/CSSComputedStyleDeclaration.cpp:
(WebCore::computedTranslate):

Modified Paths

Diff

Modified: trunk/LayoutTests/imported/w3c/ChangeLog (282314 => 282315)


--- trunk/LayoutTests/imported/w3c/ChangeLog	2021-09-12 00:32:08 UTC (rev 282314)
+++ trunk/LayoutTests/imported/w3c/ChangeLog	2021-09-12 01:41:08 UTC (rev 282315)
@@ -1,3 +1,19 @@
+2021-09-11  Simon Fraser  <[email protected]>
+
+        css/css-transforms/translate-getComputedStyle.html fails
+        https://bugs.webkit.org/show_bug.cgi?id=230178
+
+        Reviewed by Antti Koivisto.
+        
+        The interpolation test appears to regress, but do so because we now correctly output calc()
+        in computed style (we just serialize the calc incorrectly).
+
+        * web-platform-tests/css/css-transforms/animation/translate-composition-expected.txt:
+        * web-platform-tests/css/css-transforms/animation/translate-interpolation-expected.txt:
+        * web-platform-tests/css/css-transforms/transforms-support-calc-expected.txt:
+        * web-platform-tests/css/css-transforms/translate-getComputedStyle-expected.txt:
+        * web-platform-tests/web-animations/animation-model/animation-types/interpolation-per-property-002-expected.txt:
+
 2021-09-10  Chris Dumez  <[email protected]>
 
         Implement navigation reporting for Cross-Origin-Opener-Policy

Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-transforms/animation/translate-composition-expected.txt (282314 => 282315)


--- trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-transforms/animation/translate-composition-expected.txt	2021-09-12 00:32:08 UTC (rev 282314)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-transforms/animation/translate-composition-expected.txt	2021-09-12 01:41:08 UTC (rev 282315)
@@ -1,22 +1,22 @@
 
-FAIL Compositing: property <translate> underlying [100px 200px 300px] from add [-50px 50%] to add [100%] at (-1) should be [-100% calc(200px + 100%) 300px] assert_equals: expected "0px 200px 300px " but got "- 100px "
-FAIL Compositing: property <translate> underlying [100px 200px 300px] from add [-50px 50%] to add [100%] at (0) should be [calc(50px + 0%) calc(200px + 50%) 300px] assert_equals: expected "50px 200px 300px " but got "- 50px "
-FAIL Compositing: property <translate> underlying [100px 200px 300px] from add [-50px 50%] to add [100%] at (0.25) should be [calc(62.5px + 25%) calc(200px + 37.5%) 300px] assert_equals: expected "62.5px 200px 300px " but got "- 37.5px "
-FAIL Compositing: property <translate> underlying [100px 200px 300px] from add [-50px 50%] to add [100%] at (0.75) should be [calc(87.5px + 75%) calc(200px + 12.5%) 300px] assert_equals: expected "87.5px 200px 300px " but got "- 12.5px "
-FAIL Compositing: property <translate> underlying [100px 200px 300px] from add [-50px 50%] to add [100%] at (1) should be [calc(100px + 100%) calc(200px + 0%) 300px] assert_equals: expected "100px 200px 300px " but got "0px "
-FAIL Compositing: property <translate> underlying [100px 200px 300px] from add [-50px 50%] to add [100%] at (2) should be [calc(150px + 200%) calc(200px - 50%) 300px] assert_equals: expected "150px 200px 300px " but got "50px "
-FAIL Compositing: property <translate> underlying [100px 200px 300px] from add [50% 100px] to replace [200px 50% 100px] at (-1) should be [100% calc(600px - 50%) 500px] assert_equals: expected "0px 600px 500px " but got "- 200px 200px - 100px "
-FAIL Compositing: property <translate> underlying [100px 200px 300px] from add [50% 100px] to replace [200px 50% 100px] at (0) should be [calc(100px + 50%) calc(300px + 0%) 300px] assert_equals: expected "100px 300px 300px " but got "0px 100px "
-FAIL Compositing: property <translate> underlying [100px 200px 300px] from add [50% 100px] to replace [200px 50% 100px] at (0.25) should be [calc(125px + 37.5%) calc(225px + 12.5%) 250px] assert_equals: expected "125px 225px 250px " but got "50px 75px 25px "
-FAIL Compositing: property <translate> underlying [100px 200px 300px] from add [50% 100px] to replace [200px 50% 100px] at (0.75) should be [calc(175px + 12.5%) calc(75px + 37.5%) 150px] assert_equals: expected "175px 75px 150px " but got "150px 25px 75px "
+FAIL Compositing: property <translate> underlying [100px 200px 300px] from add [-50px 50%] to add [100%] at (-1) should be [-100% calc(200px + 100%) 300px] assert_equals: expected "- 100 % calc ( 100 % + 200px ) 300px " but got "calc ( - 100 % - 100px ) 100 % "
+FAIL Compositing: property <translate> underlying [100px 200px 300px] from add [-50px 50%] to add [100%] at (0) should be [calc(50px + 0%) calc(200px + 50%) 300px] assert_equals: expected "calc ( 0 % + 50px ) calc ( 50 % + 200px ) 300px " but got "calc ( 0 % - 50px ) 50 % "
+FAIL Compositing: property <translate> underlying [100px 200px 300px] from add [-50px 50%] to add [100%] at (0.25) should be [calc(62.5px + 25%) calc(200px + 37.5%) 300px] assert_equals: expected "calc ( 25 % + 62.5px ) calc ( 37.5 % + 200px ) 300px " but got "calc ( 25 % - 37.5px ) 37.5 % "
+FAIL Compositing: property <translate> underlying [100px 200px 300px] from add [-50px 50%] to add [100%] at (0.75) should be [calc(87.5px + 75%) calc(200px + 12.5%) 300px] assert_equals: expected "calc ( 75 % + 87.5px ) calc ( 12.5 % + 200px ) 300px " but got "calc ( 75 % - 12.5px ) 12.5 % "
+FAIL Compositing: property <translate> underlying [100px 200px 300px] from add [-50px 50%] to add [100%] at (1) should be [calc(100px + 100%) calc(200px + 0%) 300px] assert_equals: expected "calc ( 100 % + 100px ) calc ( 0 % + 200px ) 300px " but got "100 % "
+FAIL Compositing: property <translate> underlying [100px 200px 300px] from add [-50px 50%] to add [100%] at (2) should be [calc(150px + 200%) calc(200px - 50%) 300px] assert_equals: expected "calc ( 200 % + 150px ) calc ( - 50 % + 200px ) 300px " but got "calc ( 200 % + 50px ) - 50 % "
+FAIL Compositing: property <translate> underlying [100px 200px 300px] from add [50% 100px] to replace [200px 50% 100px] at (-1) should be [100% calc(600px - 50%) 500px] assert_equals: expected "100 % calc ( - 50 % + 600px ) 500px " but got "calc ( 100 % - 200px ) calc ( - 50 % + 200px ) - 100px "
+FAIL Compositing: property <translate> underlying [100px 200px 300px] from add [50% 100px] to replace [200px 50% 100px] at (0) should be [calc(100px + 50%) calc(300px + 0%) 300px] assert_equals: expected "calc ( 50 % + 100px ) calc ( 0 % + 300px ) 300px " but got "50 % calc ( 0 % + 100px ) "
+FAIL Compositing: property <translate> underlying [100px 200px 300px] from add [50% 100px] to replace [200px 50% 100px] at (0.25) should be [calc(125px + 37.5%) calc(225px + 12.5%) 250px] assert_equals: expected "calc ( 37.5 % + 125px ) calc ( 12.5 % + 225px ) 250px " but got "calc ( 37.5 % + 50px ) calc ( 12.5 % + 75px ) 25px "
+FAIL Compositing: property <translate> underlying [100px 200px 300px] from add [50% 100px] to replace [200px 50% 100px] at (0.75) should be [calc(175px + 12.5%) calc(75px + 37.5%) 150px] assert_equals: expected "calc ( 12.5 % + 175px ) calc ( 37.5 % + 75px ) 150px " but got "calc ( 12.5 % + 150px ) calc ( 37.5 % + 25px ) 75px "
 PASS Compositing: property <translate> underlying [100px 200px 300px] from add [50% 100px] to replace [200px 50% 100px] at (1) should be [calc(200px + 0%) 50% 100px]
-FAIL Compositing: property <translate> underlying [100px 200px 300px] from add [50% 100px] to replace [200px 50% 100px] at (2) should be [calc(300px - 50%) calc(-300px + 100%) -100px] assert_equals: expected "300px - 300px - 100px " but got "400px - 100px 200px "
-FAIL Compositing: property <translate> underlying [100px 200px 300px] from replace [50% 100px] to add [200px 50% 100px] at (-1) should be [calc(-300px + 100%) -50% -400px] assert_equals: expected "- 300px 0px - 400px " but got "- 200px 200px - 100px "
+FAIL Compositing: property <translate> underlying [100px 200px 300px] from add [50% 100px] to replace [200px 50% 100px] at (2) should be [calc(300px - 50%) calc(-300px + 100%) -100px] assert_equals: expected "calc ( - 50 % + 300px ) calc ( 100 % - 300px ) - 100px " but got "calc ( - 50 % + 400px ) calc ( 100 % - 100px ) 200px "
+FAIL Compositing: property <translate> underlying [100px 200px 300px] from replace [50% 100px] to add [200px 50% 100px] at (-1) should be [calc(-300px + 100%) -50% -400px] assert_equals: expected "calc ( 100 % - 300px ) - 50 % - 400px " but got "calc ( 100 % - 200px ) calc ( - 50 % + 200px ) - 100px "
 PASS Compositing: property <translate> underlying [100px 200px 300px] from replace [50% 100px] to add [200px 50% 100px] at (0) should be [50%  calc(100px + 0%)]
-FAIL Compositing: property <translate> underlying [100px 200px 300px] from replace [50% 100px] to add [200px 50% 100px] at (0.25) should be [calc(75px + 37.5%) calc(125px + 12.5%) 100px] assert_equals: expected "75px 125px 100px " but got "50px 75px 25px "
-FAIL Compositing: property <translate> underlying [100px 200px 300px] from replace [50% 100px] to add [200px 50% 100px] at (0.75) should be [calc(225px + 12.5%) calc(175px + 37.5%) 300px] assert_equals: expected "225px 175px 300px " but got "150px 25px 75px "
-FAIL Compositing: property <translate> underlying [100px 200px 300px] from replace [50% 100px] to add [200px 50% 100px] at (1) should be [calc(300px + 0%) calc(200px + 50%) 400px] assert_equals: expected "300px 200px 400px " but got "200px 0px 100px "
-FAIL Compositing: property <translate> underlying [100px 200px 300px] from replace [50% 100px] to add [200px 50% 100px] at (2) should be [calc(600px - 50%) calc(300px + 100%) 800px] assert_equals: expected "600px 300px 800px " but got "400px - 100px 200px "
+FAIL Compositing: property <translate> underlying [100px 200px 300px] from replace [50% 100px] to add [200px 50% 100px] at (0.25) should be [calc(75px + 37.5%) calc(125px + 12.5%) 100px] assert_equals: expected "calc ( 37.5 % + 75px ) calc ( 12.5 % + 125px ) 100px " but got "calc ( 37.5 % + 50px ) calc ( 12.5 % + 75px ) 25px "
+FAIL Compositing: property <translate> underlying [100px 200px 300px] from replace [50% 100px] to add [200px 50% 100px] at (0.75) should be [calc(225px + 12.5%) calc(175px + 37.5%) 300px] assert_equals: expected "calc ( 12.5 % + 225px ) calc ( 37.5 % + 175px ) 300px " but got "calc ( 12.5 % + 150px ) calc ( 37.5 % + 25px ) 75px "
+FAIL Compositing: property <translate> underlying [100px 200px 300px] from replace [50% 100px] to add [200px 50% 100px] at (1) should be [calc(300px + 0%) calc(200px + 50%) 400px] assert_equals: expected "calc ( 0 % + 300px ) calc ( 50 % + 200px ) 400px " but got "calc ( 0 % + 200px ) 50 % 100px "
+FAIL Compositing: property <translate> underlying [100px 200px 300px] from replace [50% 100px] to add [200px 50% 100px] at (2) should be [calc(600px - 50%) calc(300px + 100%) 800px] assert_equals: expected "calc ( - 50 % + 600px ) calc ( 100 % + 300px ) 800px " but got "calc ( - 50 % + 400px ) calc ( 100 % - 100px ) 200px "
 PASS Compositing: property <translate> underlying [none] from replace [none] to add [100px] at (-1) should be [-100px]
 PASS Compositing: property <translate> underlying [none] from replace [none] to add [100px] at (0) should be [none]
 PASS Compositing: property <translate> underlying [none] from replace [none] to add [100px] at (0.25) should be [25px]

Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-transforms/animation/translate-interpolation-expected.txt (282314 => 282315)


--- trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-transforms/animation/translate-interpolation-expected.txt	2021-09-12 00:32:08 UTC (rev 282314)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-transforms/animation/translate-interpolation-expected.txt	2021-09-12 01:41:08 UTC (rev 282315)
@@ -144,25 +144,25 @@
 PASS Web Animations: property <translate> from [-100px -50px 100px] to [0px] at (1) should be [0px]
 PASS Web Animations: property <translate> from [-100px -50px 100px] to [0px] at (2) should be [100px 50px -100px]
 PASS CSS Transitions: property <translate> from [480px 400px 320px] to [240% 160%] at (-1) should be [calc(960px - 240%) calc(800px - 160%) 640px]
-PASS CSS Transitions: property <translate> from [480px 400px 320px] to [240% 160%] at (0) should be [480px 400px 320px]
+FAIL CSS Transitions: property <translate> from [480px 400px 320px] to [240% 160%] at (0) should be [480px 400px 320px] assert_equals: expected "480px 400px 320px " but got "calc ( 0 % + 480px ) calc ( 0 % + 400px ) 320px "
 PASS CSS Transitions: property <translate> from [480px 400px 320px] to [240% 160%] at (0.125) should be [calc(420px + 30%) calc(350px + 20%) 280px]
 PASS CSS Transitions: property <translate> from [480px 400px 320px] to [240% 160%] at (0.875) should be [calc(210% + 60px) calc(140% + 50px) 40px]
 PASS CSS Transitions: property <translate> from [480px 400px 320px] to [240% 160%] at (1) should be [240% 160%]
 PASS CSS Transitions: property <translate> from [480px 400px 320px] to [240% 160%] at (2) should be [calc(480% - 480px) calc(320% - 400px) -320px]
 PASS CSS Transitions with transition: all: property <translate> from [480px 400px 320px] to [240% 160%] at (-1) should be [calc(960px - 240%) calc(800px - 160%) 640px]
-PASS CSS Transitions with transition: all: property <translate> from [480px 400px 320px] to [240% 160%] at (0) should be [480px 400px 320px]
+FAIL CSS Transitions with transition: all: property <translate> from [480px 400px 320px] to [240% 160%] at (0) should be [480px 400px 320px] assert_equals: expected "480px 400px 320px " but got "calc ( 0 % + 480px ) calc ( 0 % + 400px ) 320px "
 PASS CSS Transitions with transition: all: property <translate> from [480px 400px 320px] to [240% 160%] at (0.125) should be [calc(420px + 30%) calc(350px + 20%) 280px]
 PASS CSS Transitions with transition: all: property <translate> from [480px 400px 320px] to [240% 160%] at (0.875) should be [calc(210% + 60px) calc(140% + 50px) 40px]
 PASS CSS Transitions with transition: all: property <translate> from [480px 400px 320px] to [240% 160%] at (1) should be [240% 160%]
 PASS CSS Transitions with transition: all: property <translate> from [480px 400px 320px] to [240% 160%] at (2) should be [calc(480% - 480px) calc(320% - 400px) -320px]
 PASS CSS Animations: property <translate> from [480px 400px 320px] to [240% 160%] at (-1) should be [calc(960px - 240%) calc(800px - 160%) 640px]
-PASS CSS Animations: property <translate> from [480px 400px 320px] to [240% 160%] at (0) should be [480px 400px 320px]
+FAIL CSS Animations: property <translate> from [480px 400px 320px] to [240% 160%] at (0) should be [480px 400px 320px] assert_equals: expected "480px 400px 320px " but got "calc ( 0 % + 480px ) calc ( 0 % + 400px ) 320px "
 PASS CSS Animations: property <translate> from [480px 400px 320px] to [240% 160%] at (0.125) should be [calc(420px + 30%) calc(350px + 20%) 280px]
 PASS CSS Animations: property <translate> from [480px 400px 320px] to [240% 160%] at (0.875) should be [calc(210% + 60px) calc(140% + 50px) 40px]
 PASS CSS Animations: property <translate> from [480px 400px 320px] to [240% 160%] at (1) should be [240% 160%]
 PASS CSS Animations: property <translate> from [480px 400px 320px] to [240% 160%] at (2) should be [calc(480% - 480px) calc(320% - 400px) -320px]
 PASS Web Animations: property <translate> from [480px 400px 320px] to [240% 160%] at (-1) should be [calc(960px - 240%) calc(800px - 160%) 640px]
-PASS Web Animations: property <translate> from [480px 400px 320px] to [240% 160%] at (0) should be [480px 400px 320px]
+FAIL Web Animations: property <translate> from [480px 400px 320px] to [240% 160%] at (0) should be [480px 400px 320px] assert_equals: expected "480px 400px 320px " but got "calc ( 0 % + 480px ) calc ( 0 % + 400px ) 320px "
 PASS Web Animations: property <translate> from [480px 400px 320px] to [240% 160%] at (0.125) should be [calc(420px + 30%) calc(350px + 20%) 280px]
 PASS Web Animations: property <translate> from [480px 400px 320px] to [240% 160%] at (0.875) should be [calc(210% + 60px) calc(140% + 50px) 40px]
 PASS Web Animations: property <translate> from [480px 400px 320px] to [240% 160%] at (1) should be [240% 160%]

Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-transforms/transforms-support-calc-expected.txt (282314 => 282315)


--- trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-transforms/transforms-support-calc-expected.txt	2021-09-12 00:32:08 UTC (rev 282314)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-transforms/transforms-support-calc-expected.txt	2021-09-12 01:41:08 UTC (rev 282315)
@@ -1,5 +1,5 @@
 
-FAIL translate supports calc assert_equals: expected "calc(20% + 30px) calc(100% - 200px)" but got "30px -200px"
+PASS translate supports calc
 PASS rotate supports calc
 PASS scale supports calc
 PASS perspective supports calc

Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-transforms/translate-getComputedStyle-expected.txt (282314 => 282315)


--- trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-transforms/translate-getComputedStyle-expected.txt	2021-09-12 00:32:08 UTC (rev 282314)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-transforms/translate-getComputedStyle-expected.txt	2021-09-12 01:41:08 UTC (rev 282315)
@@ -1,3 +1,3 @@
 
-FAIL computed style for translate assert_equals: expected "30% 40% 50px" but got "0px 0px 50px"
+PASS computed style for translate
 

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


--- trunk/LayoutTests/imported/w3c/web-platform-tests/web-animations/animation-model/animation-types/interpolation-per-property-002-expected.txt	2021-09-12 00:32:08 UTC (rev 282314)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/web-animations/animation-model/animation-types/interpolation-per-property-002-expected.txt	2021-09-12 01:41:08 UTC (rev 282315)
@@ -217,7 +217,7 @@
 PASS translate with two unspecified values
 PASS translate with one unspecified value
 PASS translate with all three values specified
-FAIL translate with combination of percentages and lengths assert_equals: The value should be calc(0% + 200px) calc(25% - 50.5px) 200px at 500ms expected "calc(0% + 200px) calc(25% - 50.5px) 200px" but got "200px -50.5px 200px"
+PASS translate with combination of percentages and lengths
 PASS scale (type: scaleList) has testInterpolation function
 PASS scale with two unspecified values
 PASS scale with one unspecified value

Modified: trunk/Source/WebCore/ChangeLog (282314 => 282315)


--- trunk/Source/WebCore/ChangeLog	2021-09-12 00:32:08 UTC (rev 282314)
+++ trunk/Source/WebCore/ChangeLog	2021-09-12 01:41:08 UTC (rev 282315)
@@ -1,3 +1,21 @@
+2021-09-11  Simon Fraser  <[email protected]>
+
+        css/css-transforms/translate-getComputedStyle.html fails
+        https://bugs.webkit.org/show_bug.cgi?id=230178
+
+        Reviewed by Antti Koivisto.
+        
+        https://drafts.csswg.org/css-transforms-2/#propdef-translate says that the computed value of
+        the translate property is "the keyword none or a pair of computed <length-percentage> values
+        and an absolute length" and has a note saying "Note: The resolved value of the translate
+        property is the computed value, and thus getComputedStyle() includes percentage values in
+        its results." so implement that.
+
+        Tested by imported/w3c/web-platform-tests/css/css-transforms/translate-getComputedStyle.html
+
+        * css/CSSComputedStyleDeclaration.cpp:
+        (WebCore::computedTranslate):
+
 2021-09-11  Antti Koivisto  <[email protected]>
 
         Move rest of the LegacyInlineTextBox painting code to TextBoxPainter

Modified: trunk/Source/WebCore/css/CSSComputedStyleDeclaration.cpp (282314 => 282315)


--- trunk/Source/WebCore/css/CSSComputedStyleDeclaration.cpp	2021-09-12 00:32:08 UTC (rev 282314)
+++ trunk/Source/WebCore/css/CSSComputedStyleDeclaration.cpp	2021-09-12 01:41:08 UTC (rev 282315)
@@ -623,6 +623,8 @@
     return list;
 }
 
+// https://drafts.csswg.org/css-transforms-2/#propdef-translate
+// Computed value: the keyword none or a pair of computed <length-percentage> values and an absolute length
 static Ref<CSSValue> computedTranslate(RenderObject* renderer, const RenderStyle& style)
 {
     auto* translate = style.translate();
@@ -629,23 +631,14 @@
     if (!translate || !rendererCanBeTransformed(renderer) || translate->isIdentity())
         return CSSValuePool::singleton().createIdentifierValue(CSSValueNone);
 
-    FloatRect pixelSnappedRect;
-    if (is<RenderBox>(*renderer))
-        pixelSnappedRect = snapRectToDevicePixels(downcast<RenderBox>(*renderer).borderBoxRect(), renderer->document().deviceScaleFactor());
+    auto list = CSSValueList::createSpaceSeparated();
+    list->append(zoomAdjustedPixelValueForLength(translate->x(), style));
 
-    TransformationMatrix transform;
-    translate->apply(transform, pixelSnappedRect.size());
+    if (!translate->y().isZero() || !translate->z().isZero())
+        list->append(zoomAdjustedPixelValueForLength(translate->y(), style));
 
-    auto list = CSSValueList::createSpaceSeparated();
-    if (transform.isAffine()) {
-        list->append(zoomAdjustedPixelValue(transform.e(), style));
-        if (transform.f())
-            list->append(zoomAdjustedPixelValue(transform.f(), style));
-    } else {
-        list->append(zoomAdjustedPixelValue(transform.m41(), style));
-        list->append(zoomAdjustedPixelValue(transform.m42(), style));
-        list->append(zoomAdjustedPixelValue(transform.m43(), style));
-    }
+    if (!translate->z().isZero())
+        list->append(zoomAdjustedPixelValueForLength(translate->z(), style));
 
     return list;
 }
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to