mirror of
https://github.com/RGBCube/serenity
synced 2025-07-26 07:27:45 +00:00
LibWeb: Use a WeakPtr for DocumentFragment's "host" field
We had a reference cycle between fragments and their hosts.
This commit is contained in:
parent
7a82a6dfe8
commit
fdb647c097
2 changed files with 12 additions and 4 deletions
|
@ -26,13 +26,14 @@ public:
|
|||
|
||||
virtual FlyString node_name() const override { return "#document-fragment"; }
|
||||
|
||||
RefPtr<Element> host() { return m_host; }
|
||||
const RefPtr<Element> host() const { return m_host; }
|
||||
Element* host() { return m_host; }
|
||||
Element const* host() const { return m_host; }
|
||||
|
||||
void set_host(Element& host) { m_host = host; }
|
||||
|
||||
private:
|
||||
RefPtr<Element> m_host;
|
||||
// https://dom.spec.whatwg.org/#concept-documentfragment-host
|
||||
WeakPtr<Element> m_host;
|
||||
};
|
||||
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue