diff --git a/Userland/Libraries/LibWeb/HTML/Window.cpp b/Userland/Libraries/LibWeb/HTML/Window.cpp index 6b1fbc9e94..cb6d30caff 100644 --- a/Userland/Libraries/LibWeb/HTML/Window.cpp +++ b/Userland/Libraries/LibWeb/HTML/Window.cpp @@ -703,6 +703,13 @@ BrowsingContext* Window::browsing_context() return m_associated_document->browsing_context(); } +// https://html.spec.whatwg.org/multipage/nav-history-apis.html#window-navigable +JS::GCPtr Window::navigable() const +{ + // A Window's navigable is the navigable whose active document is the Window's associated Document's, or null if there is no such navigable. + return Navigable::navigable_with_active_document(*m_associated_document); +} + // https://html.spec.whatwg.org/multipage/system-state.html#pdf-viewer-plugin-objects Vector> Window::pdf_viewer_plugin_objects() { diff --git a/Userland/Libraries/LibWeb/HTML/Window.h b/Userland/Libraries/LibWeb/HTML/Window.h index 5f5f12baed..dcdbf161f0 100644 --- a/Userland/Libraries/LibWeb/HTML/Window.h +++ b/Userland/Libraries/LibWeb/HTML/Window.h @@ -20,6 +20,7 @@ #include #include #include +#include #include #include #include @@ -82,6 +83,8 @@ public: BrowsingContext const* browsing_context() const; BrowsingContext* browsing_context(); + JS::GCPtr navigable() const; + size_t document_tree_child_browsing_context_count() const; ImportMap const& import_map() const { return m_import_map; }