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
parent b1e77b3522
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

@ -345,6 +345,7 @@ private:
ParseErrorOr<NonnullRefPtr<StyleValue const>> parse_css_value(PropertyID, TokenStream<ComponentValue>&, Optional<String> original_source_text = {});
ParseErrorOr<NonnullRefPtr<StyleValue const>> parse_descriptor_value(AtRuleID, DescriptorID, TokenStream<ComponentValue>&);
RefPtr<StyleValue const> parse_positional_value_list_shorthand(PropertyID, TokenStream<ComponentValue>&);
RefPtr<StyleValue const> parse_css_value_for_property(PropertyID, TokenStream<ComponentValue>&);
struct PropertyAndValue {
PropertyID property;