1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-27 03:57:44 +00:00

LibWeb/LibJS: Avoid GC visit of raw pointers where possible

This is mostly motivated for aesthetics, but also helps avoid some null
checks when we have a NonnullGCPtr<T> or in some cases a T&.
This commit is contained in:
Shannon Booth 2023-11-19 16:18:00 +13:00 committed by Sam Atkins
parent 4e04f81626
commit 6a2a7cad61
54 changed files with 100 additions and 100 deletions

View file

@ -19,8 +19,8 @@ CSSRule::CSSRule(JS::Realm& realm)
void CSSRule::visit_edges(Cell::Visitor& visitor)
{
Base::visit_edges(visitor);
visitor.visit(m_parent_style_sheet.ptr());
visitor.visit(m_parent_rule.ptr());
visitor.visit(m_parent_style_sheet);
visitor.visit(m_parent_rule);
}
// https://www.w3.org/TR/cssom/#dom-cssrule-csstext

View file

@ -70,7 +70,7 @@ ElementInlineCSSStyleDeclaration::ElementInlineCSSStyleDeclaration(DOM::Element&
void ElementInlineCSSStyleDeclaration::visit_edges(Cell::Visitor& visitor)
{
Base::visit_edges(visitor);
visitor.visit(m_element.ptr());
visitor.visit(m_element);
}
size_t PropertyOwningCSSStyleDeclaration::length() const

View file

@ -46,7 +46,7 @@ void CSSStyleSheet::initialize(JS::Realm& realm)
void CSSStyleSheet::visit_edges(Cell::Visitor& visitor)
{
Base::visit_edges(visitor);
visitor.visit(m_style_sheet_list.ptr());
visitor.visit(m_style_sheet_list);
visitor.visit(m_rules);
visitor.visit(m_owner_css_rule);
visitor.visit(m_default_namespace_rule);

View file

@ -37,7 +37,7 @@ void MediaQueryList::initialize(JS::Realm& realm)
void MediaQueryList::visit_edges(Cell::Visitor& visitor)
{
Base::visit_edges(visitor);
visitor.visit(m_document.ptr());
visitor.visit(m_document);
}
// https://drafts.csswg.org/cssom-view/#dom-mediaquerylist-media

View file

@ -58,7 +58,7 @@ ResolvedCSSStyleDeclaration::ResolvedCSSStyleDeclaration(DOM::Element& element)
void ResolvedCSSStyleDeclaration::visit_edges(Cell::Visitor& visitor)
{
Base::visit_edges(visitor);
visitor.visit(m_element.ptr());
visitor.visit(m_element);
}
// https://drafts.csswg.org/cssom/#dom-cssstyledeclaration-length

View file

@ -33,7 +33,7 @@ void Screen::initialize(JS::Realm& realm)
void Screen::visit_edges(Cell::Visitor& visitor)
{
Base::visit_edges(visitor);
visitor.visit(m_window.ptr());
visitor.visit(m_window);
}
Gfx::IntRect Screen::screen_rect() const

View file

@ -85,7 +85,7 @@ void StyleSheetList::visit_edges(Cell::Visitor& visitor)
Base::visit_edges(visitor);
visitor.visit(m_document);
for (auto sheet : m_sheets)
visitor.visit(sheet.ptr());
visitor.visit(sheet);
}
// https://www.w3.org/TR/cssom/#ref-for-dfn-supported-property-indices%E2%91%A1