1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 14:37:46 +00:00

LibWeb: Create and hook up a WindowProxy for each BrowsingContext

All the machinery for this was already in place, we just never created
the actual WindowProxy and installed it.
This commit is contained in:
Andreas Kling 2022-10-15 23:10:56 +02:00
parent 738e770fce
commit 3c548adf9c
5 changed files with 46 additions and 22 deletions

View file

@ -31,14 +31,11 @@ public:
virtual JS::ThrowCompletionOr<bool> internal_delete(JS::PropertyKey const&) override;
virtual JS::ThrowCompletionOr<JS::MarkedVector<JS::Value>> internal_own_property_keys() const override;
Window& window() const { return const_cast<Window&>(*m_window); }
// NOTE: Someone will have to replace the wrapped window object as well:
// "When the browsing context is navigated, the Window object wrapped by the browsing context's associated WindowProxy object is changed."
// I haven't found where that actually happens yet. Make sure to use a Badge<T> guarded setter.
JS::GCPtr<Window> window() const { return m_window; }
void set_window(Badge<BrowsingContext>, JS::NonnullGCPtr<Window>);
private:
WindowProxy(JS::Realm&, Window&);
explicit WindowProxy(JS::Realm&);
virtual void visit_edges(JS::Cell::Visitor&) override;