LibWeb: Validate ASF syntax at parse time

This commit is contained in:
Callum Law
2026-03-28 22:41:48 +13:00
committed by Sam Atkins
parent 04f634eeb2
commit 03d479c1da
Notes: github-actions[bot] 2026-03-30 18:58:46 +00:00
18 changed files with 96 additions and 31 deletions

View File

@@ -185,12 +185,6 @@ public:
GC::Ref<Descriptors> convert_to_descriptors(AtRuleID, Vector<Declaration> const& declarations);
GC::Ref<CSSStyleProperties> convert_to_style_declaration(Vector<Declaration> const&);
static void collect_arbitrary_substitution_function_presence(Vector<ComponentValue> const&, SubstitutionFunctionsPresence&);
static void collect_arbitrary_substitution_function_presence(ComponentValue const&, SubstitutionFunctionsPresence&);
private:
Parser(ParsingParams const&, Vector<Token>);
enum class ParseError : u8 {
IncludesIgnoredVendorPrefix,
SyntaxError,
@@ -198,6 +192,12 @@ private:
template<typename T>
using ParseErrorOr = ErrorOr<T, ParseError>;
static ParseErrorOr<void> collect_arbitrary_substitution_function_presence(Vector<ComponentValue> const&, SubstitutionFunctionsPresence&);
static ParseErrorOr<void> collect_arbitrary_substitution_function_presence(ComponentValue const&, SubstitutionFunctionsPresence&);
private:
Parser(ParsingParams const&, Vector<Token>);
// "Parse a stylesheet" is intended to be the normal parser entry point, for parsing stylesheets.
struct ParsedStyleSheet {
Optional<::URL::URL> location;