LibWeb: Set context for parsing against <foo-percentage> syntax

This means that we correctly parse dimension percentage mixes (i.e.
`calc(10px + 10%)` is a valid `<length-percentage>`)
This commit is contained in:
Callum Law
2026-03-08 12:43:20 +13:00
committed by Sam Atkins
parent ed2909674f
commit 614a5cf33e
Notes: github-actions[bot] 2026-03-26 01:13:21 +00:00
6 changed files with 28 additions and 10 deletions

View File

@@ -2,8 +2,8 @@ Harness status: OK
Found 106 tests
99 Pass
7 Fail
100 Pass
6 Fail
Pass Attribute 'syntax' returns expected value for ["<color>"]
Pass Attribute 'syntax' returns expected value for ["<color> | none"]
Pass Attribute 'syntax' returns expected value for ["<color># | <image> | none"]
@@ -61,7 +61,7 @@ Pass Rule applied [<image>, url("http://a/"), false]
Pass Rule applied [<integer>, 5, false]
Pass Rule applied [<length-percentage>, 10px, false]
Pass Rule applied [<length-percentage>, 10%, false]
Fail Rule applied [<length-percentage>, calc(10% + 10px), false]
Pass Rule applied [<length-percentage>, calc(10% + 10px), false]
Pass Rule applied [<length>, 10px, false]
Pass Rule applied [<number>, 2.5, false]
Pass Rule applied [<percentage>, 10%, false]

View File

@@ -2,8 +2,8 @@ Harness status: OK
Found 239 tests
209 Pass
30 Fail
210 Pass
29 Fail
Pass syntax:'*', initialValue:'a' is valid
Pass syntax:' * ', initialValue:'b' is valid
Pass syntax:'<length>', initialValue:'2px' is valid
@@ -34,7 +34,7 @@ Pass syntax:'<length>#', initialValue:'2px, 7px, calc(8px)' is valid
Pass syntax:'<percentage>', initialValue:'-9.3e3%' is valid
Pass syntax:'<length-percentage>', initialValue:'-54%' is valid
Pass syntax:'<length-percentage>', initialValue:'0' is valid
Fail syntax:'<length-percentage>', initialValue:'calc(-11px + 10.4%)' is valid
Pass syntax:'<length-percentage>', initialValue:'calc(-11px + 10.4%)' is valid
Pass syntax:'<length>', initialValue:'10vmin' is valid
Pass syntax:'<percentage> | <length>+', initialValue:'calc(100vh - 10px) 30px' is valid
Pass syntax:'<number>', initialValue:'-109' is valid

View File

@@ -2,8 +2,8 @@ Harness status: OK
Found 29 tests
12 Pass
17 Fail
13 Pass
16 Fail
Pass Initial value for <length> correctly computed [calc(10px + 15px)]
Pass Initial value for <length> correctly computed [1in]
Pass Initial value for <length> correctly computed [2.54cm]
@@ -11,7 +11,7 @@ Pass Initial value for <length> correctly computed [25.4mm]
Pass Initial value for <length> correctly computed [6pc]
Pass Initial value for <length> correctly computed [72pt]
Pass Initial value for <percentage> correctly computed [calc(10% + 20%)]
Fail Initial value for <length-percentage> correctly computed [calc(1in + 10% + 4px)]
Pass Initial value for <length-percentage> correctly computed [calc(1in + 10% + 4px)]
Pass Initial value for <color> correctly computed [pink, inherits]
Pass Initial value for <color> correctly computed [purple]
Pass Initial value for <transform-function> correctly computed [rotate(42deg)]