mirror of
https://github.com/fergalmoran/ladybird.git
synced 2026-01-02 06:37:52 +00:00
LibWeb: Make the layout tree GC-allocated
This removes a set of complex reference cycles between DOM, layout tree and browsing context. It also makes lifetimes much easier to reason about, as the DOM and layout trees are now free to keep each other alive.
This commit is contained in:
@@ -18,9 +18,9 @@ HTMLLabelElement::HTMLLabelElement(DOM::Document& document, DOM::QualifiedName q
|
||||
|
||||
HTMLLabelElement::~HTMLLabelElement() = default;
|
||||
|
||||
RefPtr<Layout::Node> HTMLLabelElement::create_layout_node(NonnullRefPtr<CSS::StyleProperties> style)
|
||||
JS::GCPtr<Layout::Node> HTMLLabelElement::create_layout_node(NonnullRefPtr<CSS::StyleProperties> style)
|
||||
{
|
||||
return adopt_ref(*new Layout::Label(document(), this, move(style)));
|
||||
return heap().allocate_without_realm<Layout::Label>(document(), this, move(style));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user