LibWeb: Only resolve transform-origin keywords for the computed value

Previously, we were resolving these keywords at parse time, which gave
an incorrect serialization of the specified value.
This commit is contained in:
Tim Ledbetter
2025-06-14 00:47:59 +01:00
committed by Alexander Kalenik
parent a3f6e71e33
commit a8d5758777
Notes: github-actions[bot] 2025-06-15 14:02:58 +00:00
7 changed files with 131 additions and 17 deletions

View File

@@ -0,0 +1,16 @@
Harness status: OK
Found 10 tests
8 Pass
2 Fail
Pass e.style['transform-origin'] = "1px 2px 3%" should not set the property value
Pass e.style['transform-origin'] = "1px 2px left" should not set the property value
Pass e.style['transform-origin'] = "1px 2px 3px 4px" should not set the property value
Fail e.style['transform-origin'] = "1px left" should not set the property value
Fail e.style['transform-origin'] = "top 1px" should not set the property value
Pass e.style['transform-origin'] = "right left" should not set the property value
Pass e.style['transform-origin'] = "top bottom" should not set the property value
Pass e.style['transform-origin'] = "bottom 10% right 20%" should not set the property value
Pass e.style['transform-origin'] = "right 30% top -60px" should not set the property value
Pass e.style['transform-origin'] = "right 20px bottom 30px" should not set the property value

View File

@@ -0,0 +1,22 @@
Harness status: OK
Found 16 tests
12 Pass
4 Fail
Pass e.style['transform-origin'] = "left" should set the property value
Pass e.style['transform-origin'] = "center" should set the property value
Pass e.style['transform-origin'] = "right" should set the property value
Pass e.style['transform-origin'] = "top" should set the property value
Pass e.style['transform-origin'] = "bottom" should set the property value
Pass e.style['transform-origin'] = "-1px" should set the property value
Pass e.style['transform-origin'] = "calc(2em + 3ex)" should set the property value
Pass e.style['transform-origin'] = "-4%" should set the property value
Pass e.style['transform-origin'] = "left center" should set the property value
Pass e.style['transform-origin'] = "center top" should set the property value
Pass e.style['transform-origin'] = "right -4%" should set the property value
Fail e.style['transform-origin'] = "-1px bottom 5px" should set the property value
Fail e.style['transform-origin'] = "center left 6px" should set the property value
Pass e.style['transform-origin'] = "top center" should set the property value
Fail e.style['transform-origin'] = "bottom right 7px" should set the property value
Fail e.style['transform-origin'] = "-1px -2px -3px" should set the property value