LibWeb/CSS: Implement "parse with a <syntax>"

Uses the SyntaxNode tree to parse a list of ComponentValues into some
kind of StyleValue.
This commit is contained in:
Sam Atkins 2025-07-11 12:17:36 +01:00 committed by Tim Ledbetter
commit 0a5e8c2865
Notes: github-actions[bot] 2025-07-16 13:49:04 +00:00
6 changed files with 140 additions and 7 deletions

View file

@ -144,6 +144,8 @@ public:
};
static Optional<Vector<ComponentValue>> parse_declaration_value(TokenStream<ComponentValue>&, StopAtComma = StopAtComma::No);
NonnullRefPtr<CSSStyleValue const> parse_with_a_syntax(Vector<ComponentValue> const& input, SyntaxNode const& syntax, Optional<DOM::AbstractElement> const& element = {});
private:
Parser(ParsingParams const&, Vector<Token>);
@ -517,6 +519,8 @@ private:
NonnullRefPtr<CSSStyleValue const> resolve_unresolved_style_value(DOM::AbstractElement&, GuardedSubstitutionContexts&, PropertyIDOrCustomPropertyName, UnresolvedStyleValue const&);
RefPtr<CSSStyleValue const> parse_according_to_syntax_node(TokenStream<ComponentValue>& tokens, SyntaxNode const& syntax_node, Optional<DOM::AbstractElement> const& element);
static bool has_ignored_vendor_prefix(StringView);
void extract_property(Declaration const&, Parser::PropertiesAndCustomProperties&);