mirror of
https://github.com/RGBCube/serenity
synced 2025-05-20 14:05:08 +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:
parent
83c5ff57d8
commit
268b9c5d90
72 changed files with 258 additions and 207 deletions
|
@ -23,11 +23,11 @@ HTMLProgressElement::HTMLProgressElement(DOM::Document& document, DOM::Qualified
|
|||
|
||||
HTMLProgressElement::~HTMLProgressElement() = default;
|
||||
|
||||
RefPtr<Layout::Node> HTMLProgressElement::create_layout_node(NonnullRefPtr<CSS::StyleProperties> style)
|
||||
JS::GCPtr<Layout::Node> HTMLProgressElement::create_layout_node(NonnullRefPtr<CSS::StyleProperties> style)
|
||||
{
|
||||
if (style->appearance().value_or(CSS::Appearance::Auto) == CSS::Appearance::None)
|
||||
return HTMLElement::create_layout_node(style);
|
||||
return adopt_ref(*new Layout::Progress(document(), *this, move(style)));
|
||||
return heap().allocate_without_realm<Layout::Progress>(document(), *this, move(style));
|
||||
}
|
||||
|
||||
bool HTMLProgressElement::using_system_appearance() const
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue