LibWeb/CSS: Add method to parse <declaration-value>

This has an extra parameter to allow stopping at the first comma token,
which we need for var() and attr()'s "argument grammar".

Co-authored-by: Tim Ledbetter <tim.ledbetter@ladybird.org>
This commit is contained in:
Sam Atkins 2025-06-26 17:28:48 +01:00 committed by Tim Ledbetter
commit b417d13a7b
Notes: github-actions[bot] 2025-07-09 15:45:51 +00:00
2 changed files with 61 additions and 0 deletions

View file

@ -138,6 +138,12 @@ public:
[[nodiscard]] LengthOrCalculated parse_as_sizes_attribute(DOM::Element const& element, HTML::HTMLImageElement const* img = nullptr);
enum class StopAtComma : u8 {
No,
Yes,
};
static Optional<Vector<ComponentValue>> parse_declaration_value(TokenStream<ComponentValue>&, StopAtComma = StopAtComma::No);
private:
Parser(ParsingParams const&, Vector<Token>);