1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 13:57:35 +00:00

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 `{`.)
This commit is contained in:
Andreas Kling 2022-09-14 21:36:36 +02:00
parent f64c175960
commit c5a19a4d55

View file

@ -2608,7 +2608,7 @@ CSSRule* Parser::convert_to_rule(NonnullRefPtr<Rule> 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 {};
}