1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-26 19:47:46 +00:00

LibWeb: Add DOM::Window::page()

This helps us to get from a Window to the containing Page, without
clients having to go through Document.
This commit is contained in:
Andreas Kling 2021-09-09 13:45:03 +02:00
parent 84fcf879f9
commit d392349b6e
4 changed files with 18 additions and 5 deletions

View file

@ -33,6 +33,9 @@ public:
virtual bool dispatch_event(NonnullRefPtr<Event>) override;
virtual JS::Object* create_wrapper(JS::GlobalObject&) override;
Page* page();
Page const* page() const;
const Document& document() const { return m_document; }
Document& document() { return m_document; }