LibWeb/CSS: Make UnresolvedStyleValue figure out if it contains ASFs

UnresolvedStyleValue::create() has one user where we know if there are
any arbitrary substitution functions in the list of CVs, and two users
where we don't know and just hope there aren't any. I'm about to add
another user that also doesn't know, and so it seems worth just making
UnresolvedStyleValue::create() do that work instead.

We keep the parameter, now Optional<>, so that we save some redundant
work in that one place where we do already know.
This commit is contained in:
Sam Atkins 2025-07-10 14:19:24 +01:00 committed by Tim Ledbetter
commit d18b0c07ca
Notes: github-actions[bot] 2025-07-16 13:49:59 +00:00
4 changed files with 30 additions and 14 deletions

View file

@ -4314,7 +4314,7 @@ NonnullRefPtr<CSSStyleValue const> Parser::resolve_unresolved_style_value(DOM::A
// NB: Custom properties have no grammar as such, so we skip this step for them.
// FIXME: Parse according to @property syntax once we support that.
if (property_id == PropertyID::Custom)
return UnresolvedStyleValue::create(move(result), false, {});
return UnresolvedStyleValue::create(move(result));
auto expanded_value_tokens = TokenStream { result };
auto parsed_value = parse_css_value(property_id, expanded_value_tokens);