1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-26 04:37:44 +00:00

LibWeb: Tie layout tree to a specific browsing context

Now that both the layout tree and browsing context are GC-allocated,
we can formalize their relationship a bit better by having layout
nodes keep a NonnullGCPtr to the browsing context.

This makes the previously-indirect link direct, removing an unpleasant
"how do we know the browsing context is alive" question when accessing
it from the layout tree.
This commit is contained in:
Andreas Kling 2022-10-20 18:20:34 +02:00
parent b9dc0b7d1b
commit 6d830e6335
2 changed files with 6 additions and 4 deletions

View file

@ -152,6 +152,8 @@ private:
JS::NonnullGCPtr<DOM::Node> m_dom_node;
RefPtr<Painting::Paintable> m_paintable;
JS::NonnullGCPtr<HTML::BrowsingContext> m_browsing_context;
size_t m_serial_id { 0 };
bool m_anonymous { false };