LibWeb/CSS: Return GC::Ref from Parser::convert_to_style_declaration()

This commit is contained in:
Sam Atkins 2025-03-18 13:41:46 +00:00
parent a28197669a
commit 9b06f66571
Notes: github-actions[bot] 2025-03-19 13:54:06 +00:00
4 changed files with 7 additions and 31 deletions

View file

@ -505,12 +505,7 @@ GC::Ptr<CSSMediaRule> Parser::convert_to_media_rule(AtRule const& rule, Nested n
child_rules.append(child_rule);
},
[&](Vector<Declaration> const& declarations) {
auto* declaration = convert_to_style_declaration(declarations);
if (!declaration) {
dbgln_if(CSS_PARSER_DEBUG, "CSSParser: nested declarations invalid; discarding.");
return;
}
child_rules.append(CSSNestedDeclarations::create(realm(), *declaration));
child_rules.append(CSSNestedDeclarations::create(realm(), *convert_to_style_declaration(declarations)));
});
}
auto rule_list = CSSRuleList::create(realm(), child_rules);