LibWeb/CSS: Reject trailing unparseable tokens in property values

Without this, we'd happily parse `font-variant-caps: small-caps potato`
as just `small-caps` and ignore the fact that unused tokens were left
over.

This fix gets us some WPT subtest passes, and removes the need for a
bespoke parsing function for font-variant-caps.
This commit is contained in:
Sam Atkins 2025-02-06 15:05:31 +00:00
commit cda3fe7a4b
Notes: github-actions[bot] 2025-02-12 16:02:07 +00:00
11 changed files with 28 additions and 62 deletions

View file

@ -2,12 +2,11 @@ Harness status: OK
Found 7 tests
6 Pass
1 Fail
7 Pass
Pass e.style['box-sizing'] = "margin-box" should not set the property value
Pass e.style['box-sizing'] = "padding-box" should not set the property value
Pass e.style['box-sizing'] = "fill-box" should not set the property value
Pass e.style['box-sizing'] = "stroke-box" should not set the property value
Pass e.style['box-sizing'] = "view-box" should not set the property value
Pass e.style['box-sizing'] = "content-box border-box" should not set the property value
Fail e.style['box-sizing'] = "content-box, border-box" should not set the property value
Pass e.style['box-sizing'] = "content-box, border-box" should not set the property value

View file

@ -2,8 +2,7 @@ Harness status: OK
Found 11 tests
10 Pass
1 Fail
11 Pass
Pass e.style['min-height'] = "none" should not set the property value
Pass e.style['min-height'] = "complex" should not set the property value
Pass e.style['min-height'] = "-10%" should not set the property value
@ -13,5 +12,5 @@ Pass e.style['min-height'] = "10px 20%" should not set the property value
Pass e.style['min-height'] = "max-content 10px" should not set the property value
Pass e.style['min-height'] = "min-content max-content" should not set the property value
Pass e.style['min-height'] = "available" should not set the property value
Fail e.style['min-height'] = "10px border-box" should not set the property value
Pass e.style['min-height'] = "10px border-box" should not set the property value
Pass e.style['min-height'] = "content-box 20%" should not set the property value

View file

@ -2,8 +2,7 @@ Harness status: OK
Found 11 tests
10 Pass
1 Fail
11 Pass
Pass e.style['min-width'] = "none" should not set the property value
Pass e.style['min-width'] = "complex" should not set the property value
Pass e.style['min-width'] = "-10%" should not set the property value
@ -13,5 +12,5 @@ Pass e.style['min-width'] = "10px 20%" should not set the property value
Pass e.style['min-width'] = "max-content 10px" should not set the property value
Pass e.style['min-width'] = "min-content max-content" should not set the property value
Pass e.style['min-width'] = "available" should not set the property value
Fail e.style['min-width'] = "10px border-box" should not set the property value
Pass e.style['min-width'] = "10px border-box" should not set the property value
Pass e.style['min-width'] = "content-box 20%" should not set the property value