LibWeb: Add generic logic for parsing "positional-value-list-shorthands"

Continues the work started in #5386 to simplify handling of positional
value list shorthand properties.

Previously we would parse these as `StyleValueList`s and then rely on
`StyleComputer::for_each_property_expanding_shorthands` to expand them
into longhands.

This required a bit of work to handle `ShorthandStyleValue`s for the
`@page` `margin` descriptor.
This commit is contained in:
Callum Law 2025-09-09 20:47:11 +12:00 committed by Jelle Raaijmakers
commit a7e5ded188
Notes: github-actions[bot] 2025-09-09 09:47:05 +00:00
6 changed files with 57 additions and 199 deletions

View file

@ -53,9 +53,8 @@ Parser::ParseErrorOr<NonnullRefPtr<StyleValue const>> Parser::parse_descriptor_v
auto value_for_property = value_or_error.release_value();
// Descriptors don't accept the following, which properties do:
// - CSS-wide keywords
// - Shorthands
// - Arbitrary substitution functions (so, UnresolvedStyleValue)
if (value_for_property->is_css_wide_keyword() || value_for_property->is_shorthand() || value_for_property->is_unresolved())
if (value_for_property->is_css_wide_keyword() || value_for_property->is_unresolved())
return nullptr;
return value_for_property;
},