mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-05-24 20:12:53 +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
|
@ -22,11 +22,11 @@ namespace Web::CSS {
|
|||
|
||||
GC_DEFINE_ALLOCATOR(CSSRuleList);
|
||||
|
||||
GC::Ref<CSSRuleList> CSSRuleList::create(JS::Realm& realm, GC::RootVector<CSSRule*> const& rules)
|
||||
GC::Ref<CSSRuleList> CSSRuleList::create(JS::Realm& realm, ReadonlySpan<GC::Ref<CSSRule>> rules)
|
||||
{
|
||||
auto rule_list = realm.create<CSSRuleList>(realm);
|
||||
for (auto* rule : rules)
|
||||
rule_list->m_rules.append(*rule);
|
||||
for (auto rule : rules)
|
||||
rule_list->m_rules.append(rule);
|
||||
return rule_list;
|
||||
}
|
||||
|
||||
|
@ -36,11 +36,6 @@ CSSRuleList::CSSRuleList(JS::Realm& realm)
|
|||
m_legacy_platform_object_flags = LegacyPlatformObjectFlags { .supports_indexed_properties = 1 };
|
||||
}
|
||||
|
||||
GC::Ref<CSSRuleList> CSSRuleList::create_empty(JS::Realm& realm)
|
||||
{
|
||||
return realm.create<CSSRuleList>(realm);
|
||||
}
|
||||
|
||||
void CSSRuleList::initialize(JS::Realm& realm)
|
||||
{
|
||||
WEB_SET_PROTOTYPE_FOR_INTERFACE(CSSRuleList);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue