From 8d82dc3a9fa2c4405ab5ce00d5de0495574c353e Mon Sep 17 00:00:00 2001 From: Aliaksandr Kalenik Date: Thu, 7 Sep 2023 12:51:34 +0200 Subject: [PATCH] LibWeb: Update `Window::top()` to use navigables --- Userland/Libraries/LibWeb/HTML/Window.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Userland/Libraries/LibWeb/HTML/Window.cpp b/Userland/Libraries/LibWeb/HTML/Window.cpp index 47c5682c43..25af5e3ddf 100644 --- a/Userland/Libraries/LibWeb/HTML/Window.cpp +++ b/Userland/Libraries/LibWeb/HTML/Window.cpp @@ -890,12 +890,12 @@ u32 Window::length() JS::GCPtr Window::top() const { // 1. If this's navigable is null, then return null. - auto const* browsing_context = this->browsing_context(); - if (!browsing_context) + auto navigable = this->navigable(); + if (!navigable) return {}; // 2. Return this's navigable's top-level traversable's active WindowProxy. - return browsing_context->top_level_browsing_context()->window_proxy(); + return navigable->top_level_traversable()->active_window_proxy(); } // https://html.spec.whatwg.org/multipage/nav-history-apis.html#dom-parent