mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-11-22 23:50:19 +00:00
LibWeb: Update Window::set_name()
to use navigables
This commit is contained in:
parent
c95215f829
commit
5d12dea4c9
Notes:
sideshowbarker
2024-07-16 19:42:24 +09:00
Author: https://github.com/kalenikaliaksandr Commit: https://github.com/SerenityOS/serenity/commit/5d12dea4c9 Pull-request: https://github.com/SerenityOS/serenity/pull/18219
1 changed files with 3 additions and 2 deletions
|
@ -32,6 +32,7 @@
|
|||
#include <LibWeb/DOM/EventDispatcher.h>
|
||||
#include <LibWeb/HTML/BrowsingContext.h>
|
||||
#include <LibWeb/HTML/CustomElements/CustomElementRegistry.h>
|
||||
#include <LibWeb/HTML/DocumentState.h>
|
||||
#include <LibWeb/HTML/EventHandler.h>
|
||||
#include <LibWeb/HTML/EventLoop/EventLoop.h>
|
||||
#include <LibWeb/HTML/Focus.h>
|
||||
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue