LibWeb/CSS: Maintain original form of media-feature ranges

Previously, for `foo < 30px` ranges, we'd flip them and store them as
`30px > foo` instead. That worked fine, but means the serialization is
wrong. So instead, keep them in their original form.

I experimented with giving Range two optional sub-structs instead of 4
optional members, thinking it would be smaller - but it's actually
larger, because the two Optional<Comparison>s fit snugly together. So,
the slightly-goofy all-Optionals remains.

This gets us 2 WPT passes that I'm aware of.
This commit is contained in:
Sam Atkins 2025-05-22 12:50:03 +01:00
parent 9b8dc6b8d0
commit 9fe8445946
Notes: github-actions[bot] 2025-05-23 09:19:11 +00:00
5 changed files with 28 additions and 32 deletions

View file

@ -2,7 +2,6 @@ Harness status: OK
Found 2 tests
1 Pass
1 Fail
2 Pass
Pass Empty CSSNestedDeclarations do not affect outer serialization
Fail Empty CSSNestedDeclarations do not affect outer serialization (nested grouping rule)
Pass Empty CSSNestedDeclarations do not affect outer serialization (nested grouping rule)

View file

@ -2,8 +2,7 @@ Harness status: OK
Found 26 tests
25 Pass
1 Fail
26 Pass
Pass Should be known: '(prefers-contrast)'
Pass Should be known: '(prefers-contrast: no-preference)'
Pass Should be known: '(prefers-contrast: more)'
@ -17,7 +16,7 @@ Pass Should be parseable: '(prefers-contrast: forced high)'
Pass Should be unknown: '(prefers-contrast: forced high)'
Pass Should be parseable: '(prefers-contrast: forced low)'
Pass Should be unknown: '(prefers-contrast: forced low)'
Fail Should be parseable: '(prefers-contrast > increase)'
Pass Should be parseable: '(prefers-contrast > increase)'
Pass Should be unknown: '(prefers-contrast > increase)'
Pass Should be parseable: '(prefers-increased-contrast)'
Pass Should be unknown: '(prefers-increased-contrast)'