LibWeb: Allow anonymous layer block rule with no declarations

This commit is contained in:
Tim Ledbetter 2025-06-17 08:01:49 +01:00 committed by Sam Atkins
parent 30cdacc05a
commit 701fcb9e87
Notes: github-actions[bot] 2025-06-17 07:59:15 +00:00
6 changed files with 51 additions and 2 deletions

View file

@ -441,6 +441,7 @@ Optional<AtRule> Parser::consume_an_at_rule(TokenStream<T>& input, Nested nested
.name = ((Token)input.consume_a_token()).at_keyword(),
.prelude = {},
.child_rules_and_lists_of_declarations = {},
.is_block_rule = false,
};
// Process input:
@ -479,6 +480,7 @@ Optional<AtRule> Parser::consume_an_at_rule(TokenStream<T>& input, Nested nested
// Consume a block from input, and assign the result to rules child rules.
m_rule_context.append(rule_context_type_for_at_rule(rule.name));
rule.child_rules_and_lists_of_declarations = consume_a_block(input);
rule.is_block_rule = true;
m_rule_context.take_last();
// If rule is valid in the current context, return it. Otherwise, return nothing.