1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 19:38:12 +00:00

LibWeb: Make StyleSheet mark its owner node

The garbage collector will take care of cycles.
This commit is contained in:
Andreas Kling 2022-09-03 15:44:44 +02:00
parent 36085676d2
commit 5724a04553
2 changed files with 4 additions and 7 deletions

View file

@ -21,15 +21,13 @@ StyleSheet::StyleSheet(HTML::Window& window_object)
void StyleSheet::visit_edges(Cell::Visitor& visitor)
{
Base::visit_edges(visitor);
visitor.visit(m_owner_node);
visitor.visit(m_parent_style_sheet);
}
void StyleSheet::set_owner_node(DOM::Element* element)
{
if (element)
m_owner_node = element->make_weak_ptr<DOM::Element>();
else
m_owner_node = nullptr;
m_owner_node = element;
}
void StyleSheet::set_parent_css_style_sheet(CSSStyleSheet* parent)