LibWeb/CSS: Expand out parse_dimension_value()

When we know what kind of dimension we want, it's awkward to attempt to
parse any dimension type, including quirks that only affect lengths, to
then throw it away unless it's the type we wanted in the first place.

Additionally, move the unitless angle/length behavior for SVG attributes
into these methods, where it belongs.

Instead, only try to parse the type of dimension we want. This is
currently more code, but some could be factored together later.
This commit is contained in:
Sam Atkins 2025-01-06 14:38:54 +00:00
commit 563f8572d5
Notes: github-actions[bot] 2025-01-08 14:30:51 +00:00
2 changed files with 222 additions and 79 deletions

View file

@ -313,7 +313,6 @@ private:
RefPtr<CSSStyleValue> parse_filter_value_list_value(TokenStream<ComponentValue>&);
RefPtr<StringStyleValue> parse_opentype_tag_value(TokenStream<ComponentValue>&);
RefPtr<CSSStyleValue> parse_dimension_value(TokenStream<ComponentValue>&);
RefPtr<CSSStyleValue> parse_angle_value(TokenStream<ComponentValue>&);
RefPtr<CSSStyleValue> parse_angle_percentage_value(TokenStream<ComponentValue>&);
RefPtr<CSSStyleValue> parse_flex_value(TokenStream<ComponentValue>&);