mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 04:07:44 +00:00
LibWeb: Make consume_a_qualified_rule() understand block tokens
This now matches the spec, and fixes the situation where if it was given a TokenStream of StyleComponentValueRules, it would drop any Blocks on the floor instead of adding them to the result StyleRule.
This commit is contained in:
parent
f1af136925
commit
9c5430b9ee
1 changed files with 7 additions and 1 deletions
|
@ -785,7 +785,13 @@ RefPtr<StyleRule> Parser::consume_a_qualified_rule(TokenStream<T>& tokens)
|
|||
return rule;
|
||||
}
|
||||
|
||||
// how is "simple block with an associated token of <{-token>" a valid token?
|
||||
if constexpr (IsSame<T, StyleComponentValueRule>) {
|
||||
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);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue