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,9 +2,8 @@ Harness status: OK
Found 4 tests
3 Pass
1 Fail
4 Pass
Pass e.style['font-stretch'] = "auto" should not set the property value
Fail e.style['font-stretch'] = "normal, ultra-condensed" should not set the property value
Pass e.style['font-stretch'] = "normal, ultra-condensed" should not set the property value
Pass e.style['font-stretch'] = "condensed expanded" should not set the property value
Pass e.style['font-stretch'] = "-50%" should not set the property value

View file

@ -2,12 +2,11 @@ Harness status: OK
Found 7 tests
5 Pass
2 Fail
7 Pass
Pass e.style['font-variant-emoji'] = "auto" should not set the property value
Pass e.style['font-variant-emoji'] = "none" should not set the property value
Pass e.style['font-variant-emoji'] = "color" should not set the property value
Pass e.style['font-variant-emoji'] = "normal text" should not set the property value
Pass e.style['font-variant-emoji'] = "text emoji" should not set the property value
Fail e.style['font-variant-emoji'] = "normal, unicode" should not set the property value
Fail e.style['font-variant-emoji'] = "unicode, emoji" should not set the property value
Pass e.style['font-variant-emoji'] = "normal, unicode" should not set the property value
Pass e.style['font-variant-emoji'] = "unicode, emoji" should not set the property value