mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 15:27:35 +00:00
LibJS+LibWeb: Wrap raw JS::Cell*/& fields in GCPtr/NonnullGCPtr
This commit is contained in:
parent
1df3652e27
commit
7c0c1c8f49
214 changed files with 825 additions and 827 deletions
|
@ -18,8 +18,8 @@ CSSGroupingRule::CSSGroupingRule(JS::Realm& realm, CSSRuleList& rules)
|
|||
: CSSRule(realm)
|
||||
, m_rules(rules)
|
||||
{
|
||||
for (auto& rule : m_rules)
|
||||
rule.set_parent_rule(this);
|
||||
for (auto& rule : *m_rules)
|
||||
rule->set_parent_rule(this);
|
||||
}
|
||||
|
||||
JS::ThrowCompletionOr<void> CSSGroupingRule::initialize(JS::Realm& realm)
|
||||
|
@ -33,32 +33,32 @@ JS::ThrowCompletionOr<void> CSSGroupingRule::initialize(JS::Realm& realm)
|
|||
void CSSGroupingRule::visit_edges(Cell::Visitor& visitor)
|
||||
{
|
||||
Base::visit_edges(visitor);
|
||||
visitor.visit(&m_rules);
|
||||
visitor.visit(m_rules);
|
||||
}
|
||||
|
||||
WebIDL::ExceptionOr<u32> CSSGroupingRule::insert_rule(StringView rule, u32 index)
|
||||
{
|
||||
TRY(m_rules.insert_a_css_rule(rule, index));
|
||||
TRY(m_rules->insert_a_css_rule(rule, index));
|
||||
// NOTE: The spec doesn't say where to set the parent rule, so we'll do it here.
|
||||
m_rules.item(index)->set_parent_rule(this);
|
||||
m_rules->item(index)->set_parent_rule(this);
|
||||
return index;
|
||||
}
|
||||
|
||||
WebIDL::ExceptionOr<void> CSSGroupingRule::delete_rule(u32 index)
|
||||
{
|
||||
return m_rules.remove_a_css_rule(index);
|
||||
return m_rules->remove_a_css_rule(index);
|
||||
}
|
||||
|
||||
void CSSGroupingRule::for_each_effective_style_rule(Function<void(CSSStyleRule const&)> const& callback) const
|
||||
{
|
||||
m_rules.for_each_effective_style_rule(callback);
|
||||
m_rules->for_each_effective_style_rule(callback);
|
||||
}
|
||||
|
||||
void CSSGroupingRule::set_parent_style_sheet(CSSStyleSheet* parent_style_sheet)
|
||||
{
|
||||
CSSRule::set_parent_style_sheet(parent_style_sheet);
|
||||
for (auto& rule : m_rules)
|
||||
rule.set_parent_style_sheet(parent_style_sheet);
|
||||
for (auto& rule : *m_rules)
|
||||
rule->set_parent_style_sheet(parent_style_sheet);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue