mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-07-12 12:01:52 +00:00
LibWeb/CSS: Combine the CSSRuleList constructors
This commit is contained in:
parent
3d1665cc80
commit
9465492edf
Notes:
github-actions[bot]
2025-04-23 10:40:08 +00:00
Author: https://github.com/AtkinsSJ
Commit: 9465492edf
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/4354
7 changed files with 19 additions and 25 deletions
|
@ -497,12 +497,12 @@ GC::Ptr<CSSMediaRule> Parser::convert_to_media_rule(AtRule const& rule, Nested n
|
|||
auto media_query_list = parse_a_media_query_list(media_query_tokens);
|
||||
auto media_list = MediaList::create(realm(), move(media_query_list));
|
||||
|
||||
GC::RootVector<CSSRule*> child_rules { realm().heap() };
|
||||
GC::RootVector<GC::Ref<CSSRule>> child_rules { realm().heap() };
|
||||
for (auto const& child : rule.child_rules_and_lists_of_declarations) {
|
||||
child.visit(
|
||||
[&](Rule const& rule) {
|
||||
if (auto child_rule = convert_to_rule(rule, nested))
|
||||
child_rules.append(child_rule);
|
||||
child_rules.append(*child_rule);
|
||||
},
|
||||
[&](Vector<Declaration> const& declarations) {
|
||||
child_rules.append(CSSNestedDeclarations::create(realm(), *convert_to_style_declaration(declarations)));
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue