summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrew Kaster <akaster@serenityos.org>2022-09-25 18:16:08 -0600
committerLinus Groh <mail@linusgroh.de>2022-10-01 21:05:32 +0100
commita1286f5120f2b3742580ca391bf59cd8c9652bb0 (patch)
treedb9207f601678b5fb44d91afb6087a86e7dd45a0
parent394f1b38369fd9cdbdd982fbd4129fa9dc6c5dd3 (diff)
downloadserenity-a1286f5120f2b3742580ca391bf59cd8c9652bb0.zip
LibWeb: Ensure that replaced documents keep the Window of their sibling
The note in the spec says that we're supposed to make sure this new document has the same Window as the old about:blank document, but we forgot to actually assign to the Window pointer.
-rw-r--r--Userland/Libraries/LibWeb/DOM/Document.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/Userland/Libraries/LibWeb/DOM/Document.cpp b/Userland/Libraries/LibWeb/DOM/Document.cpp
index c9cd9801fc..702c8c5ffc 100644
--- a/Userland/Libraries/LibWeb/DOM/Document.cpp
+++ b/Userland/Libraries/LibWeb/DOM/Document.cpp
@@ -153,6 +153,8 @@ JS::NonnullGCPtr<Document> Document::create_and_initialize(Type type, String con
&& navigation_params.history_handling == HTML::HistoryHandlingBehavior::Replace
&& (browsing_context->active_document() && browsing_context->active_document()->origin().is_same_origin(navigation_params.origin))) {
// Do nothing.
+ // NOTE: This means that both the initial about:blank Document, and the new Document that is about to be created, will share the same Window object.
+ window = browsing_context->active_window();
}
// 6. Otherwise: