1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 10:38:11 +00:00

LibWeb: Implement CSS::parse_css_value()

A lot of this is not spec-compliant and copied from the old parser.
In future PRs, we can revise it.
This commit is contained in:
Sam Atkins 2021-07-09 21:04:34 +01:00 committed by Andreas Kling
parent c91c00f587
commit 6b6bf4a0aa
3 changed files with 224 additions and 5 deletions

View file

@ -122,8 +122,7 @@ public:
template<typename T>
Vector<Selector> parse_a_relative_selector(TokenStream<T>&);
template<typename T>
RefPtr<StyleValue> parse_css_value(PropertyID, TokenStream<T>&);
RefPtr<StyleValue> parse_css_value(PropertyID, TokenStream<StyleComponentValueRule>&);
// FIXME: https://drafts.csswg.org/css-backgrounds-3/
static Optional<String> as_valid_background_repeat(String input) { return input; }
@ -171,6 +170,8 @@ private:
[[nodiscard]] RefPtr<CSSRule> convert_to_rule(NonnullRefPtr<StyleRule>);
[[nodiscard]] RefPtr<CSSStyleDeclaration> convert_to_declaration(NonnullRefPtr<StyleBlockRule>);
static Optional<float> try_parse_float(StringView string);
ParsingContext m_context;
Tokenizer m_tokenizer;