From 5d12dea4c9b8b2b6143cf17bb27d871eb93c082e Mon Sep 17 00:00:00 2001 From: Aliaksandr Kalenik Date: Thu, 7 Sep 2023 13:03:36 +0200 Subject: [PATCH] LibWeb: Update `Window::set_name()` to use navigables --- Userland/Libraries/LibWeb/HTML/Window.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/Userland/Libraries/LibWeb/HTML/Window.cpp b/Userland/Libraries/LibWeb/HTML/Window.cpp index 0ae4253c805..05034f285cd 100644 --- a/Userland/Libraries/LibWeb/HTML/Window.cpp +++ b/Userland/Libraries/LibWeb/HTML/Window.cpp @@ -32,6 +32,7 @@ #include #include #include +#include #include #include #include @@ -828,11 +829,11 @@ String Window::name() const void Window::set_name(String const& name) { // 1. If this's navigable is null, then return. - if (!browsing_context()) + if (!navigable()) return; // 2. Set this's navigable's active session history entry's document state's navigable target name to the given value. - browsing_context()->set_name(name); + navigable()->active_session_history_entry()->document_state->set_navigable_target_name(name); } // https://html.spec.whatwg.org/multipage/nav-history-apis.html#dom-location