Commit Graph

2 Commits

Author SHA1 Message Date
Andreas Kling
717f18909b LibWeb: Handle trailing whitespace in display value parsing
When a var() fallback value contained trailing whitespace (e.g.
`var(--foo, flex )`), parse_display_value() miscounted the tokens.
The remaining_token_count() check included whitespace tokens, routing
single-keyword values like "flex" to the multi-component path. The
multi-component parser then failed when encountering the trailing
whitespace token.

Fix this by counting only non-whitespace tokens for the single vs
multi-component routing decision, and by skipping whitespace in the
multi-component parsing loop.
2026-03-21 21:42:44 -05:00
Andreas Kling
86b3c37222 Tests: Add test for var() fallback values with trailing whitespace
This test shows that var() fallback values with trailing whitespace
(e.g. `var(--foo, flex )`) fail to parse correctly for the display
property, falling back to initial values instead.
2026-03-21 21:42:44 -05:00