LibWeb/CSS: Evaluate Supports query components during parsing

Instead of parsing the parts of a `@supports` query, then only
evaluating them when constructing the Supports itself, we can instead
evaluate them as we parse them. This simplifies things as we no longer
need to pass a Realm around, and don't have to re-parse the conditions
again with a new Parser instance.
This commit is contained in:
Sam Atkins 2025-03-13 16:04:48 +00:00
parent 95730c66aa
commit 84a695c958
Notes: github-actions[bot] 2025-03-17 10:01:49 +00:00
5 changed files with 32 additions and 48 deletions

View file

@ -87,11 +87,4 @@ RefPtr<CSS::Supports> parse_css_supports(CSS::Parser::ParsingParams const& conte
return CSS::Parser::Parser::create(context, string).parse_as_supports();
}
Optional<CSS::StyleProperty> parse_css_supports_condition(CSS::Parser::ParsingParams const& context, StringView string)
{
if (string.is_empty())
return {};
return CSS::Parser::Parser::create(context, string).parse_as_supports_condition();
}
}