mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-05-29 14:32:55 +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
|
@ -141,7 +141,7 @@ GC::Ref<CSS::CSSStyleSheet> Parser::parse_as_css_stylesheet(Optional<::URL::URL>
|
|||
auto const& style_sheet = parse_a_stylesheet(m_token_stream, location);
|
||||
|
||||
// Interpret all of the resulting top-level qualified rules as style rules, defined below.
|
||||
GC::RootVector<CSSRule*> rules(realm().heap());
|
||||
GC::RootVector<GC::Ref<CSSRule>> rules(realm().heap());
|
||||
for (auto const& raw_rule : style_sheet.rules) {
|
||||
auto rule = convert_to_rule(raw_rule, Nested::No);
|
||||
// If any style rule is invalid, or any at-rule is not recognized or is invalid according to its grammar or context, it’s a parse error.
|
||||
|
@ -150,7 +150,7 @@ GC::Ref<CSS::CSSStyleSheet> Parser::parse_as_css_stylesheet(Optional<::URL::URL>
|
|||
log_parse_error();
|
||||
continue;
|
||||
}
|
||||
rules.append(rule);
|
||||
rules.append(*rule);
|
||||
}
|
||||
|
||||
auto rule_list = CSSRuleList::create(realm(), rules);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue