mirror of
https://github.com/fergalmoran/ladybird.git
synced 2026-01-04 15:45:25 +00:00
LibWeb: Make Nodes actually ref/unref their Document
Oops, it seems like I implemented all of the "nodes keep the document alive" mechanism except the part where the functions are actually called. :^) Fixes #3811.
This commit is contained in:
@@ -54,12 +54,14 @@ Node::Node(Document& document, NodeType type)
|
||||
, m_document(&document)
|
||||
, m_type(type)
|
||||
{
|
||||
m_document->ref_from_node({});
|
||||
}
|
||||
|
||||
Node::~Node()
|
||||
{
|
||||
if (layout_node() && layout_node()->parent())
|
||||
layout_node()->parent()->remove_child(*layout_node());
|
||||
m_document->unref_from_node({});
|
||||
}
|
||||
|
||||
const HTML::HTMLAnchorElement* Node::enclosing_link_element() const
|
||||
|
||||
Reference in New Issue
Block a user