From c0be1a0360248581fa3f9af81a38eba069befa43 Mon Sep 17 00:00:00 2001 From: Domenic Denicola Date: Mon, 24 Aug 2020 15:36:40 -0400 Subject: [PATCH 1/2] Editorial: consolidate some navigation inputs Fixes #5847, by consolidating the explicit replacementEnabled with the previously-implicit "reload-triggered navigation" and "entry update" booleans. They are now unified into a "history handling" parameter, which is explicitly passed in as needed, and makes it clear what the four possible history handling behaviors are. --- source | 266 +++++++++++++++++++++++++++++++-------------------------- 1 file changed, 147 insertions(+), 119 deletions(-) diff --git a/source b/source index f4d2cae493d..f94af2e7d63 100644 --- a/source +++ b/source @@ -14591,10 +14591,9 @@ people expect to have work and what is necessary. flag set does not have the sandboxed automatic features browsing context flag set, then navigate document's browsing context to - urlRecord, with replacementEnabled set to true and the - source browsing context set to document's browsing context.

+ urlRecord, with historyHandling set to "replace" and the source browsing context set to + document's browsing context.

For the purposes of the previous paragraph, a refresh is said to have come due as soon as the later of the following two conditions occurs:

@@ -23359,13 +23358,14 @@ document.body.appendChild(wbr); request's referrer to "no-referrer".

-
  • Let replacementEnabled be true if windowType is not "existing or none"; otherwise, false.

  • +
  • Let historyHandling be "replace" if + windowType is not "existing or none"; otherwise, "default".

  • Queue an element task on the DOM manipulation task source given subject to navigate target to - request with replacementEnabled set - to replacementEnabled and the source browsing context set to + request with historyHandling set to + historyHandling and the source browsing context set to source.

  • @@ -30116,23 +30116,23 @@ interface HTMLIFrameElement : HTMLElement { element and a resource resource:

      -
    1. Let replacementEnabled be false.

      +
    2. Let historyHandling be "default".

    3. If element's nested browsing context's session history contains only one Document, and that was the about:blank Document created when element's nested browsing context was - created, then set replacementEnabled to true.

    4. + created, then set historyHandling to "replace".

    5. If element's nested browsing context's active - document is not completely loaded, then set replacementEnabled to - true.

    6. + document is not completely loaded, then set historyHandling to + "replace".

    7. Navigate element's nested browsing context to resource, with replacementEnabled set to - replacementEnabled and the source browsing context set to - element's node document's browsing - context.

    8. + data-x="navigation-hh">historyHandling set to historyHandling and the + source browsing context set to element's node document's + browsing context.

    @@ -30786,10 +30786,10 @@ interface HTMLEmbedElement : HTMLElement {
  • Navigate element's nested browsing context to - response, with replacementEnabled set to true and the - source browsing context set to element's node - document's browsing context.

    + response, with historyHandling set to + "replace" and the source browsing context + set to element's node document's browsing context.

    element's src attribute does not get updated if the browsing context gets further navigated to other @@ -31471,10 +31471,10 @@ interface HTMLObjectElement : HTMLElement {

    If the URL of the given resource is not about:blank, then navigate the element's nested browsing - context to that resource, with replacementEnabled set to true and the - source browsing context set to the object element's node - document's browsing context. (The to that resource, with historyHandling set + to "replace" and the source browsing context + set to the object element's node document's browsing context. (The data attribute of the object element doesn't get updated if the browsing context gets further navigated to other locations.)

    @@ -55710,15 +55710,16 @@ fur applying the rules for choosing a browsing context using target, form browsing context, and noopener.

  • -
  • Let replace be true if windowType is either "new and unrestricted" or "new with no opener", and false +

  • Let historyHandling be "replace" if + windowType is either "new and unrestricted" or "new with no opener", and "default" otherwise.

  • If target browsing context is null, then return.

  • If form document has not yet completely loaded and the submitted from submit() method flag is set, then - set replace to true.

  • + set historyHandling to "replace".

  • If the value of method is

    Set the form's planned navigation to null.

  • Navigate target browsing context to - destination, with replacementEnabled set to replace.

    + destination, with historyHandling set to + historyHandling.

    - -

    For the purposes of this task, target browsing context and replace are the variables that were set up when the overall form submission - algorithm was run, with their values as they stood when this planned navigation - was queued.

  • Set the form's planned navigation to the just-queued same browsing context, such that the mapping is then 1-to-2. This occurs when a browsing context is navigated from the initial about:blank Document to another, with replacementEnabled set to true.

    + data-x="navigation-hh">historyHandling set to "replace".

    Creating browsing contexts

    @@ -77819,7 +77817,8 @@ console.assert(iframeWindow.frameElement === null);

    If the newly created browsing context is immediately navigated, then the navigation will be done with replacementEnabled set to true.

    + data-x="navigation-hh">historyHandling set to "replace".

    If the user agent has been configured such that in this instance it will reuse @@ -78418,11 +78417,19 @@ dictionary WindowPostMessageOptions : PostMessageOptions data-x="event-load">load at window, with the legacy target override flag set.

    -
  • Otherwise, navigate target browsing - context to request, with exceptionsEnabled set to - true, replacementEnabled set to - new, and the source browsing context set to source browsing - context.

  • +
  • +

    Otherwise:

    + +
      +
    1. Let historyHandling be "replace" if + new is true; otherwise, "default".

    2. + +
    3. Navigate target browsing context to + request, with exceptionsEnabled set to true, historyHandling set to historyHandling, and the + source browsing context set to source browsing context.

    4. +
    +
  • @@ -81733,11 +81740,11 @@ interface Location { // but see also replace".

  • -

    If any of the following conditions are met, then set replacementEnabled to - false:

    +

    If any of the following conditions are met, then set historyHandling to "default":