From 5d9d0aa2674ba67c64183264e04180b3d3ed43eb Mon Sep 17 00:00:00 2001 From: Andrew Kaster Date: Sun, 4 Feb 2024 03:38:11 -0700 Subject: [PATCH] LibWeb: Replace check for BrowsingContext's about blank state with false This check has been if (false && stuff) for quite a while, since the transition to Navigables. No one updates the BrowsingContext's session history, so the check for it having an about blank document and only an about blank document is always false. --- Userland/Libraries/LibWeb/DOM/Document.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/Userland/Libraries/LibWeb/DOM/Document.cpp b/Userland/Libraries/LibWeb/DOM/Document.cpp index f283e0e069..3db7e97d52 100644 --- a/Userland/Libraries/LibWeb/DOM/Document.cpp +++ b/Userland/Libraries/LibWeb/DOM/Document.cpp @@ -181,7 +181,11 @@ WebIDL::ExceptionOr> Document::create_and_initialize( // 7. If browsingContext's active document's is initial about:blank is true, // and browsingContext's active document's origin is same origin-domain with navigationParams's origin, // then set window to browsingContext's active window. - if (browsing_context->still_on_its_initial_about_blank_document() + // FIXME: still_on_its_initial_about_blank_document() is not in the spec anymore. + // However, replacing this with the spec-mandated is_initial_about_blank() results in the browsing context + // holding an incorrect active document for the replace from initial about:blank to the real document. + // See #22293 for more details. + if (false && (browsing_context->active_document() && browsing_context->active_document()->origin().is_same_origin(navigation_params.origin))) { window = browsing_context->active_window(); }