From 472a85614f487ccb88850f70120a66dbf19da683 Mon Sep 17 00:00:00 2001 From: Domenic Denicola Date: Tue, 4 May 2021 17:42:56 -0400 Subject: [PATCH 1/2] Allow document.open() to desync session history and document URLs Closes #6556. In particular, reverts document.open() to only update the document's URL, and not the session history entry's URL, like it did before ae7cf0cc1936c6c309d7279c822dffc3af147851. Now that they can mismatch, we need to audit the cases where this might be important, which leads to the following changes: * Changes location.reload() to reload the current session history entry's URL, instead of the document's URL. This ensures that post-document.open() reload behavior is aligned with WebKit and Gecko, as tested by https://wpt.fyi/results/html/webappapis/dynamic-markup-insertion/opening-the-input-stream/reload.window.html. * Changes history.pushState()/history.replaceState() with no URL argument to default to the document's URL, instead of the current session history's URL. This ensures that post-document.open() pushState()/replaceState() behavior is aligned with all engines, as tested by https://github.com/web-platform-tests/wpt/pull/28826. This also modernizes and makes a bit more precise the location.reload() method steps. The user-initiated reload steps remain vague; #6600 will tackle those. --- source | 113 +++++++++++++++++++++++++++++++++++++-------------------- 1 file changed, 74 insertions(+), 39 deletions(-) diff --git a/source b/source index 0a3fef09ea2..60084fad7cc 100644 --- a/source +++ b/source @@ -83619,7 +83619,16 @@ interface BarProp { data-x="struct item">items: