From 44f2958fa50514f4cd83bfca07311fc111b8a436 Mon Sep 17 00:00:00 2001
From: Shannon Booth
Date: Wed, 3 Jun 2026 22:10:46 +0200
Subject: [PATCH] Don't update active document too early for same-origin
navigations
The active document was previously derived from the active window's
associated Document, which changes during create-and-initialize for
an initial about:blank same-origin navigation before the new document
is made active. By making active document a variable of browsing context
only set by the make active algorithm, this allows the document to be
updated at the right time.
---
source | 9 ++++++---
1 file changed, 6 insertions(+), 3 deletions(-)
diff --git a/source b/source
index 313ebb8e783..c885855a5d0 100644
--- a/source
+++ b/source
@@ -105285,6 +105285,8 @@ interface NotRestoredReasons {
context has a corresponding WindowProxy object, as well as the following:
+ An active document, a Document.
+
An opener browsing context, a browsing context or null,
initially null.
@@ -105313,9 +105315,7 @@ interface NotRestoredReasons {
A browsing context's active window is its WindowProxy
- object's [[Window]] internal slot value. A
- browsing context's active document is its active window's
- associated Document.
+ object's
[[Window]] internal slot value.
@@ -111609,6 +111609,9 @@ location.href = '#foo';
Let window be document's relevant global
object.
+
Set document's browsing context's
+ active document to document.
+
Set document's browsing context's
WindowProxy's [[Window]] internal
slot value to window.