From c5a19a4d55000c540755a5dd7d8a73114cca5b1b Mon Sep 17 00:00:00 2001 From: Andreas Kling Date: Wed, 14 Sep 2022 21:36:36 +0200 Subject: [PATCH] LibWeb: Allow CSS at-rules to have an empty prelude I don't see any indication in the spec that an empty prelude should be disallowed. This fixes rules like `@font-face{...}` (note the absence of whitespace before the `{`.) --- Userland/Libraries/LibWeb/CSS/Parser/Parser.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Userland/Libraries/LibWeb/CSS/Parser/Parser.cpp b/Userland/Libraries/LibWeb/CSS/Parser/Parser.cpp index 1f438e2227..f29328c723 100644 --- a/Userland/Libraries/LibWeb/CSS/Parser/Parser.cpp +++ b/Userland/Libraries/LibWeb/CSS/Parser/Parser.cpp @@ -2608,7 +2608,7 @@ CSSRule* Parser::convert_to_rule(NonnullRefPtr rule) if (has_ignored_vendor_prefix(rule->at_rule_name())) { return {}; } else if (rule->at_rule_name().equals_ignoring_case("font-face"sv)) { - if (rule->prelude().is_empty() || !rule->block() || !rule->block()->is_curly()) { + if (!rule->block() || !rule->block()->is_curly()) { dbgln_if(CSS_PARSER_DEBUG, "@font-face rule is malformed."); return {}; }