From 3171abe92a8192987c4078c322d0e61696c74b40 Mon Sep 17 00:00:00 2001 From: Aliaksandr Kalenik Date: Thu, 31 Aug 2023 12:20:30 +0200 Subject: [PATCH] LibWeb: Call Document::set_window() from Document::make_active() --- Userland/Libraries/LibWeb/DOM/Document.cpp | 2 ++ Userland/Libraries/LibWeb/HTML/BrowsingContext.cpp | 2 -- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Userland/Libraries/LibWeb/DOM/Document.cpp b/Userland/Libraries/LibWeb/DOM/Document.cpp index 5e1bbc0578..27e4e81548 100644 --- a/Userland/Libraries/LibWeb/DOM/Document.cpp +++ b/Userland/Libraries/LibWeb/DOM/Document.cpp @@ -3011,6 +3011,8 @@ void Document::make_active() // 1. Let window be document's relevant global object. auto& window = verify_cast(HTML::relevant_global_object(*this)); + set_window(window); + // 2. Set document's browsing context's WindowProxy's [[Window]] internal slot value to window. m_browsing_context->window_proxy()->set_window(window); diff --git a/Userland/Libraries/LibWeb/HTML/BrowsingContext.cpp b/Userland/Libraries/LibWeb/HTML/BrowsingContext.cpp index f01f83196e..86c51d9107 100644 --- a/Userland/Libraries/LibWeb/HTML/BrowsingContext.cpp +++ b/Userland/Libraries/LibWeb/HTML/BrowsingContext.cpp @@ -207,7 +207,6 @@ JS::NonnullGCPtr BrowsingContext::create_a_new_browsing_context auto document = HTML::HTMLDocument::create(window->realm()); // Non-standard - document->set_window(*window); window->set_associated_document(*document); document->set_quirks_mode(DOM::QuirksMode::Yes); @@ -365,7 +364,6 @@ WebIDL::ExceptionOr BrowsingContext auto document = HTML::HTMLDocument::create(window->realm()); // Non-standard - document->set_window(*window); window->set_associated_document(*document); // type: "html"