LibWeb: Use shortest serialization for shorthands with repeated values

For shorthands where all the values are repeated, we now only output
the value once.
This commit is contained in:
Tim Ledbetter 2025-03-20 10:58:38 +00:00 committed by Jelle Raaijmakers
commit 54351e7327
Notes: github-actions[bot] 2025-03-20 13:32:03 +00:00
8 changed files with 81 additions and 30 deletions

View file

@ -2,5 +2,5 @@ Harness status: OK
Found 1 tests
1 Fail
Fail gap is interpolable
1 Pass
Pass gap is interpolable

View file

@ -2,5 +2,5 @@ Harness status: OK
Found 1 tests
1 Fail
Fail gap: normal is not interpolable
1 Pass
Pass gap: normal is not interpolable

View file

@ -2,5 +2,5 @@ Harness status: OK
Found 1 tests
1 Fail
Fail Default gap is not interpolable
1 Pass
Pass Default gap is not interpolable

View file

@ -2,20 +2,20 @@ Harness status: OK
Found 16 tests
6 Pass
10 Fail
Fail e.style['gap'] = "normal" should set the property value
Fail e.style['gap'] = "10px" should set the property value
Fail e.style['gap'] = "normal normal" should set the property value
Fail e.style['gap'] = "10px 10px" should set the property value
12 Pass
4 Fail
Pass e.style['gap'] = "normal" should set the property value
Pass e.style['gap'] = "10px" should set the property value
Pass e.style['gap'] = "normal normal" should set the property value
Pass e.style['gap'] = "10px 10px" should set the property value
Pass e.style['column-gap'] = "normal" should set the property value
Pass e.style['column-gap'] = "10px" should set the property value
Pass e.style['row-gap'] = "normal" should set the property value
Pass e.style['row-gap'] = "10px" should set the property value
Fail 'row-gap: normal; column-gap: normal;' is serialized to 'gap: normal;'
Fail getPropertyValue for 'row-gap: normal; column-gap: normal;' returns 'normal'
Pass getPropertyValue for 'row-gap: normal; column-gap: normal;' returns 'normal'
Fail 'row-gap: 10px; column-gap: 10px;' is serialized to 'gap: 10px;'
Fail getPropertyValue for 'row-gap: 10px; column-gap: 10px;' returns '10px'
Pass getPropertyValue for 'row-gap: 10px; column-gap: 10px;' returns '10px'
Fail 'row-gap: 10px; column-gap: normal;' is serialized to 'gap: 10px normal;'
Pass getPropertyValue for 'row-gap: 10px; column-gap: normal;' returns '10px normal'
Fail 'column-gap: normal; row-gap: 10px;' is serialized to 'gap: 10px normal;'

View file

@ -0,0 +1,14 @@
Harness status: OK
Found 9 tests
9 Pass
Pass e.style['gap'] = "normal normal" should set the property value
Pass e.style['gap'] = "10px 10px" should set the property value
Pass e.style['gap'] = "20% 20%" should set the property value
Pass e.style['gap'] = "calc(20% + 10px) calc(20% + 10px)" should set the property value
Pass e.style['gap'] = "normal 10px" should set the property value
Pass e.style['gap'] = "10px 20%" should set the property value
Pass e.style['gap'] = "20% calc(20% + 10px)" should set the property value
Pass e.style['gap'] = "calc(20% + 10px) 0px" should set the property value
Pass e.style['gap'] = "0px normal" should set the property value