From caac0706c2a1ad10d65e0d382aefa7a29b9e8d21 Mon Sep 17 00:00:00 2001 From: Sam Atkins Date: Fri, 15 Oct 2021 16:32:01 +0100 Subject: [PATCH] LibWeb: Accept a Block token as the body of a CSS At-Rule I previously fixed this for `consume_a_qualified_rule()` and didn't notice the same comment in `consume_an_at_rule()` until now. --- Userland/Libraries/LibWeb/CSS/Parser/Parser.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/Userland/Libraries/LibWeb/CSS/Parser/Parser.cpp b/Userland/Libraries/LibWeb/CSS/Parser/Parser.cpp index de28da9894..fe6162559e 100644 --- a/Userland/Libraries/LibWeb/CSS/Parser/Parser.cpp +++ b/Userland/Libraries/LibWeb/CSS/Parser/Parser.cpp @@ -1204,7 +1204,13 @@ NonnullRefPtr Parser::consume_an_at_rule(TokenStream& tokens) return rule; } - // how is "simple block with an associated token of <{-token>" a valid token? + if constexpr (IsSame) { + StyleComponentValueRule const& component_value = token; + if (component_value.is_block() && component_value.block().is_curly()) { + rule->m_block = component_value.block(); + return rule; + } + } tokens.reconsume_current_input_token(); auto value = consume_a_component_value(tokens);