LibWeb: Distinguish between empty block at-rules and statement at-rules

This commit is contained in:
Tim Ledbetter 2025-06-17 08:07:48 +01:00 committed by Sam Atkins
parent 701fcb9e87
commit 59a2e10a4e
Notes: github-actions[bot] 2025-06-17 07:59:09 +00:00
3 changed files with 60 additions and 2 deletions

View file

@ -196,7 +196,7 @@ GC::Ptr<CSSImportRule> Parser::convert_to_import_rule(AtRule const& rule)
return {};
}
if (!rule.child_rules_and_lists_of_declarations.is_empty()) {
if (rule.is_block_rule) {
dbgln_if(CSS_PARSER_DEBUG, "Failed to parse @import rule: Block is not allowed.");
return {};
}
@ -470,7 +470,7 @@ GC::Ptr<CSSNamespaceRule> Parser::convert_to_namespace_rule(AtRule const& rule)
return {};
}
if (!rule.child_rules_and_lists_of_declarations.is_empty()) {
if (rule.is_block_rule) {
dbgln_if(CSS_PARSER_DEBUG, "Failed to parse @namespace rule: Block is not allowed.");
return {};
}