diff --git a/source b/source index 5052495dfbb..0838bab0812 100644 --- a/source +++ b/source @@ -99394,18 +99394,18 @@ interface NavigationHistoryEntry : EventTarget data-x="dom-NavigationOptions-info">info"], if it exists; otherwise, undefined.

-
  • Let apiMethodTracker be the result of maybe setting the upcoming non-traverse API method - tracker for this given info and - serializedState.

  • +
  • Let apiMethodTracker be the result of setting up a navigate/reload API method tracker for this + given info and serializedState.

  • Navigate document's node navigable to urlRecord using document, with historyHandling set to options["history"] and history"], navigationAPIState set to - serializedState.

    + serializedState, and apiMethodTracker + set to apiMethodTracker.

    Unlike location.assign() and friends, which are exposed across origin-domain boundaries, @@ -99418,25 +99418,6 @@ interface NavigationHistoryEntry : EventTarget Navigation object itself (i.e., document).

  • -
  • -

    If this's upcoming non-traverse API method tracker is - apiMethodTracker, then:

    - -

    If the upcoming non-traverse API method tracker is still - apiMethodTracker, this means that the navigate algorithm bailed out - before ever getting to the inner navigate event - firing algorithm which would promote that upcoming API method tracker to ongoing.

    - -
      -
    1. Set this's upcoming non-traverse API method tracker to - null.

    2. - -
    3. Return an early error result for - an "AbortError" DOMException.

    4. -
    -
  • -
  • Return a navigation API method tracker-derived result for apiMethodTracker.

  • @@ -99490,14 +99471,14 @@ interface NavigationHistoryEntry : EventTarget data-x="dom-NavigationOptions-info">info"], if it exists; otherwise, undefined.

    -
  • Let apiMethodTracker be the result of maybe setting the upcoming non-traverse API method - tracker for this given info and - serializedState.

  • +
  • Let apiMethodTracker be the result of setting up a navigate/reload API method tracker for this + given info and serializedState.

  • Reload document's node navigable with navigationAPIState set to - serializedState.

  • + data-x="reload-navigation-api-state">navigationAPIState
    set to serializedState and + apiMethodTracker set to + apiMethodTracker.

  • Return a navigation API method tracker-derived result for apiMethodTracker.

  • @@ -99705,12 +99686,21 @@ interface NavigationHistoryEntry : EventTarget
    -

    A navigation API method tracker-derived result for a navigation API method - tracker is a NavigationResult dictionary instance given by «[ "committed" → apiMethodTracker's committed promise, "finished" → apiMethodTracker's finished promise ]».

    +

    To compute the navigation API method tracker-derived result for a navigation + API method tracker-or-null apiMethodTracker:

    + +
      +
    1. If apiMethodTracker is pending, then return an early error result for an + "AbortError" DOMException.

    2. + +
    3. Return a NavigationResult dictionary instance given by «[ "committed" → apiMethodTracker's committed promise, "finished" → apiMethodTracker's finished promise ]».

    4. +
    @@ -99815,9 +99805,6 @@ const p2 = navigation.navigate(url2).finished;
  • Ongoing API method tracker, a navigation API method tracker or null, initially null.

  • -
  • Upcoming non-traverse API method tracker, a navigation API method - tracker or null, initially null.

  • -
  • Upcoming traverse API method trackers, an ordered map from strings to navigation API method trackers, initially empty.

  • @@ -99850,14 +99837,16 @@ const p2 = navigation.navigate(url2).finished;
  • A finished promise, a promise

  • + +
  • A pending, a boolean.

  • All this state is then managed via the following algorithms.

    -

    To maybe set the upcoming non-traverse API method tracker given a - Navigation navigation, a JavaScript value info, and a - serialized state-or-null serializedState:

    +

    To set up a navigate/reload API method tracker given a Navigation + navigation, a JavaScript value info, and a serialized + state-or-null serializedState:

    1. Let committedPromise and finishedPromise be new promises created in @@ -99891,7 +99880,7 @@ const p2 = navigation.navigate(url2).finished;

    2. -

      Let apiMethodTracker be a new navigation API method tracker with:

      +

      Return a new navigation API method tracker with:

      navigation object
      @@ -99914,27 +99903,12 @@ const p2 = navigation.navigate(url2).finished;
      finished promise
      finishedPromise
      -
      -
    3. - -
    4. Assert: navigation's upcoming non-traverse API method - tracker is null.

    5. -
    6. -

      If navigation does not have - entries and events disabled, then set navigation's upcoming - non-traverse API method tracker to apiMethodTracker.

      - -

      If navigation has entries and events disabled, then - committedPromise and finishedPromise will never fulfill (since we never - create a NavigationHistoryEntry object for such Documents, and so we - have nothing to resolve them with); there is no NavigationHistoryEntry to apply - serializedState to; and there is no navigate - event to include info with. So, we don't need to track this API method call after - all.

      +
      pending
      +
      false if navigation has entries and events disabled; otherwise + true
      +
    7. - -
    8. Return apiMethodTracker.

    @@ -99978,6 +99952,9 @@ const p2 = navigation.navigate(url2).finished;
    finished promise
    finishedPromise
    + +
    pending
    +
    false
    @@ -99988,51 +99965,6 @@ const p2 = navigation.navigate(url2).finished; -
    -

    To promote an upcoming API method tracker to ongoing given a Navigation - navigation and a string-or-null destinationKey:

    - -
      -
    1. Assert: navigation's ongoing API method tracker is - null.

    2. - -
    3. -

      If destinationKey is not null, then:

      - -
        -
      1. Assert: navigation's upcoming non-traverse API method - tracker is null.

      2. - -
      3. -

        If navigation's upcoming traverse API method - trackers[destinationKey] exists, then:

        - -
          -
        1. Set navigation's ongoing API method tracker to - navigation's upcoming traverse API method - trackers[destinationKey].

        2. - -
        3. Remove navigation's upcoming - traverse API method trackers[destinationKey].

        4. -
        -
      4. -
      -
    4. - -
    5. -

      Otherwise:

      - -
        -
      1. Set navigation's ongoing API method tracker to - navigation's upcoming non-traverse API method tracker.

      2. - -
      3. Set navigation's upcoming non-traverse API method tracker to - null.

      4. -
      -
    6. -
    -
    -

    To clean up a navigation API method tracker apiMethodTracker:

    @@ -101303,16 +101235,42 @@ interface NavigationDestination { data-x="fire-navigate-prr-formDataEntryList">formDataEntryList (default null), an optional serialized state navigationAPIState (default - StructuredSerializeForStorage(null)), and an optional serialized + StructuredSerializeForStorage(null)), an optional serialized state-or-null classicHistoryAPIState (default - null):

    + null), and an optional navigation API method tracker-or-null apiMethodTrackerForNavigateOrReload:

      +
    1. Let document be navigation's relevant global object's associated Document.

    2. +
    3. Inform the navigation API about aborting navigation in - navigation's relevant global object's associated Document's node - navigable.

    4. + document's node navigable.

      + +
    5. +

      If navigation has entries and events disabled, and + apiMethodTrackerForNavigateOrReload is not null:

      + +
        +
      1. Set apiMethodTrackerForNavigateOrReload's pending to false.

      2. + +
      3. Set apiMethodTrackerForNavigateOrReload to null.

      4. +
      + +

      If navigation has entries and events disabled, then + navigate() and reload() calls return promises that will never fulfill. We + never create a NavigationHistoryEntry object for such Documents, there + is no NavigationHistoryEntry to apply serializedState to, and there is + no navigate event to include info with. So, we + don't need to track this API method call after all. We need to check this after aborting + previous navigations, in case the Document has became non-fully active + as a result of a navigateerror event.

      +
    6. + +
    7. If document is not fully active, then return false.

    8. Let event be the result of creating an event given NavigateEvent, in navigation's NavigationDestination {

    9. Return the result of performing the inner navigate event firing algorithm given navigation, navigationType, event, destination, - userInvolvement, sourceElement, formDataEntryList, and - null.

    10. + userInvolvement, sourceElement, formDataEntryList, null, and + apiMethodTracker.

    @@ -101397,8 +101355,9 @@ interface NavigationDestination { NavigationType navigationType, a NavigateEvent event, a NavigationDestination destination, a user navigation involvement userInvolvement, an Element-or-null - sourceElement, an entry list-or-null formDataEntryList, and a - string-or-null downloadRequestFilename:

    + sourceElement, an entry list-or-null formDataEntryList, a + string-or-null downloadRequestFilename, and an optional navigation API method + tracker-or-null apiMethodTracker (default null):

    1. @@ -101408,12 +101367,11 @@ interface NavigationDestination {
    2. Assert: navigation's ongoing API method tracker is null.

    3. -
    4. Assert: navigation's upcoming non-traverse API method - tracker is null.

    5. -
    6. Assert: navigation's upcoming traverse API method trackers is empty.

    7. +
    8. Assert: apiMethodTracker is null.

    9. +
    10. Return true.

    @@ -101421,28 +101379,48 @@ interface NavigationDestination { data-x="dom-Navigation-traverseTo">traverseTo(), back(), and forward() will immediately fail when entries and events - are disabled (since there are no entries to traverse to), and if our starting point is instead - navigate() or reload(), then we avoided setting the - upcoming non-traverse API method tracker in the first place.

    + are disabled (since there are no entries to traverse to).

    -
  • Let destinationKey be null.

  • +
  • Assert: navigation's ongoing API method tracker is + null.

  • -
  • If destination's entry is non-null, then set - destinationKey to destination's entry's key.

  • +
  • +

    If destination's entry + is non-null:

    -
  • Assert: destinationKey is not the empty string.

  • +
      +
    1. +

      Assert: apiMethodTracker is null.

      -
    2. Promote an upcoming API method tracker to ongoing given - navigation and destinationKey.

    3. +

      apiMethodTracker is passed as an argument only for navigate() and reload() calls. + -

    4. Let apiMethodTracker be navigation's ongoing API method - tracker.

    5. +
    6. Let destinationKey be destination's entry's key.

    7. + +
    8. Assert: destinationKey is not the empty string.

    9. + +
    10. +

      If navigation's upcoming traverse API method + trackers[destinationKey] exists:

      + +
        +
      1. Set apiMethodTracker to navigation's upcoming traverse API + method trackers[destinationKey].

      2. + +
      3. Remove navigation's upcoming + traverse API method trackers[destinationKey].

      4. +
      +
    11. +
    + + +
  • If apiMethodTracker is not null, then set apiMethodTracker's pending to false.

  • Let navigable be navigation's relevant global object's navigable.

  • @@ -106092,10 +106070,11 @@ location.href = '#foo'; string), an optional user navigation involvement userInvolvement (default "none"), an optional Element sourceElement (default null), and an - optional boolean initialInsertion (default - false):

    + data-x="navigation-source-element">sourceElement (default null), an optional + boolean initialInsertion (default false), and an + optional navigation API method tracker-or-null apiMethodTracker (default null):

    1. Let cspNavigationType be "form-submission" if @@ -106345,9 +106324,10 @@ location.href = '#foo'; to sourceElement, formDataEntryList set to entryListForFiring, destinationURL - set to url, and navigationAPIState set to - navigationAPIStateForFiring.

    2. + set to url, navigationAPIState + set to navigationAPIStateForFiring, and apiMethodTracker set to + apiMethodTracker.

    3. If continue is false, then return.

    @@ -107654,10 +107634,12 @@ location.href = '#foo';

    To reload a navigable navigable given an optional serialized state-or-null navigationAPIState (default null) and an + data-x="reload-navigation-api-state">navigationAPIState (default null), an optional user navigation involvement userInvolvement (default "none"):

    + data-x="uni-none">none"), and an optional navigation API method + tracker-or-null apiMethodTracker + (default null):

    1. @@ -107684,9 +107666,11 @@ location.href = '#foo'; data-x="fire-navigate-prr-userInvolvement">userInvolvement set to userInvolvement, destinationURL set to navigable's active session history - entry's URL, and 's URL, navigationAPIState set to - destinationNavigationAPIState.

    2. + destinationNavigationAPIState, and apiMethodTracker set to + apiMethodTracker.

    3. If continue is false, then return.