From 71a317d1d08af357d311bc86ee6449f9b149d7a9 Mon Sep 17 00:00:00 2001 From: Domenic Denicola Date: Wed, 24 Aug 2016 16:59:16 -0400 Subject: [PATCH] Fix reloads to not wipe out future session history Fixes #1578. When performing a reload via location.reload() or a user interface element, it seems more correct to go down the "entry update" path, instead of going down the normal path and turning on "replacement enabled". The normal path wipes out all session history entries after the current one, which is not what browsers do when reloading. --- source | 40 +++++++++++++++++++++------------------- 1 file changed, 21 insertions(+), 19 deletions(-) diff --git a/source b/source index 2cffbc04e9f..390b85fc197 100644 --- a/source +++ b/source @@ -80509,7 +80509,7 @@ interface History { invoking must instead throw a "SecurityError" DOMException.

-

When the forward()method is invoked, the +

When the forward() method is invoked, the user agent must traverse the history by a delta +1. If this History object is associated with a Document that is not fully active, invoking must instead throw a "SecurityError" @@ -81610,11 +81610,16 @@ State: <OUTPUT NAME=I>1</OUTPUT> <INPUT VALUE="Increment" TYPE=BUTTON O

Otherwise

Navigate the browsing context to - the document's URL with the exceptions - enabled flag set and replacement enabled. The source browsing - context must be the browsing context being navigated. This is a - reload-triggered navigation. Rethrow any exceptions.

- + this Location object's relevant Document's URL to perform an entry update of the + browsing context's current entry, with the exceptions + enabled flag set. The source browsing context must be the + browsing context being navigated. This is a reload-triggered + navigation. Rethrow any exceptions.

+ + @@ -81623,14 +81628,15 @@ State: <OUTPUT NAME=I>1</OUTPUT> <INPUT VALUE="Increment" TYPE=BUTTON O

When a user requests that the active document of a browsing context be reloaded through a user interface element, the user agent should navigate the browsing context to the same resource as that - Document, with replacement enabled. In the case of non-idempotent - methods (e.g. HTTP POST), the user agent should prompt the user to confirm the operation first, - since otherwise transactions (e.g. purchases or database modifications) could be repeated. User - agents may allow the user to explicitly override any caches when reloading. If browsing - context's active document's reload override flag is set, then the - user agent may instead perform an overridden reload rather than the navigation - described in this paragraph (with the browsing context being reloaded as the - source browsing context).

+ Document, to perform an entry update of the browsing + context's current entry. This is a reload-triggered navigation. + In the case of non-idempotent methods (e.g. HTTP POST), the user agent should prompt the user to + confirm the operation first, since otherwise transactions (e.g. purchases or database + modifications) could be repeated. User agents may allow the user to explicitly override any caches + when reloading. If browsing context's active document's reload + override flag is set, then the user agent may instead perform an overridden + reload rather than the navigation described in this paragraph (with the browsing + context being reloaded as the source browsing context).


@@ -82513,11 +82519,6 @@ State: <OUTPUT NAME=I>1</OUTPUT> <INPUT VALUE="Increment" TYPE=BUTTON O -

This can only happen if the entry being updated is not the current - entry, and can never happen with replacement enabled. (It happens when the - user tried to traverse to a session history entry that no longer had a Document - object.)

- @@ -120077,6 +120078,7 @@ INSERT INTERFACES HERE T. J. Crowder, Tab Atkins-Bittner, Taiju Tsuiki, + Takashi Toyoshima, Takayoshi Kochi, Takeshi Yoshino, Tantek Çelik,