mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 04:27:45 +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
|
@ -156,7 +156,8 @@ public:
|
|||
Painting::PaintableBox const* paint_box() const;
|
||||
Painting::Paintable const* paintable() const;
|
||||
|
||||
void set_layout_node(Badge<Layout::Node>, Layout::Node*) const;
|
||||
void set_layout_node(Badge<Layout::Node>, JS::NonnullGCPtr<Layout::Node>);
|
||||
void detach_layout_node(Badge<DOM::Document>);
|
||||
|
||||
virtual bool is_child_allowed(Node const&) const { return true; }
|
||||
|
||||
|
@ -623,7 +624,7 @@ protected:
|
|||
virtual void visit_edges(Cell::Visitor&) override;
|
||||
|
||||
JS::GCPtr<Document> m_document;
|
||||
mutable WeakPtr<Layout::Node> m_layout_node;
|
||||
JS::GCPtr<Layout::Node> m_layout_node;
|
||||
NodeType m_type { NodeType::INVALID };
|
||||
bool m_needs_style_update { false };
|
||||
bool m_child_needs_style_update { false };
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue