From b264d18ad142cd1a958f06db5224447d5acfea9c Mon Sep 17 00:00:00 2001 From: Shannon Booth Date: Sun, 17 Nov 2024 21:43:25 +1300 Subject: [PATCH] LibWeb: Fix missing auxiliary logic for cross document navigation I noticed this missing check when trying to debug an unrelated issue. I don't know what it could fix, but this seems like an oversight. --- Libraries/LibWeb/HTML/Navigable.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/Libraries/LibWeb/HTML/Navigable.cpp b/Libraries/LibWeb/HTML/Navigable.cpp index 3a42cd7dda4..d16df4135cf 100644 --- a/Libraries/LibWeb/HTML/Navigable.cpp +++ b/Libraries/LibWeb/HTML/Navigable.cpp @@ -1875,8 +1875,11 @@ void finalize_a_cross_document_navigation(GC::Ref navigable, HistoryH // - historyEntry's document's browsing context is not an auxiliary browsing context whose opener browsing context is non-null; and // - historyEntry's document's origin is not navigable's active document's origin // then set historyEntry's document state's navigable target name to the empty string. - if (navigable->parent() == nullptr && history_entry->document()->browsing_context()->opener_browsing_context() != nullptr && history_entry->document()->origin() != navigable->active_document()->origin()) + if (navigable->parent() == nullptr + && !(history_entry->document()->browsing_context()->is_auxiliary() && history_entry->document()->browsing_context()->opener_browsing_context() != nullptr) + && history_entry->document()->origin() != navigable->active_document()->origin()) { history_entry->document_state()->set_navigable_target_name(String {}); + } // 5. Let entryToReplace be navigable's active session history entry if historyHandling is "replace", otherwise null. auto entry_to_replace = history_handling == HistoryHandlingBehavior::Replace ? navigable->active_session_history_entry() : nullptr;