diff --git a/source b/source index af6a646b017..d691684c2d3 100644 --- a/source +++ b/source @@ -101851,106 +101851,92 @@ interface NavigationDestination { -
  • -

    If event's interception - state is not "none":

    +
  • If event's interception + state is "none", then return true.

  • -
      -
    1. Let fromNHE be the current - entry of navigation.

    2. +
    3. Let fromNHE be the current + entry of navigation.

    4. -
    5. Assert: fromNHE is not null.

    6. +
    7. Assert: fromNHE is not null.

    8. -
    9. -

      Set navigation's transition - to a new NavigationTransition created in navigation's - relevant realm, with +

    10. +

      Set navigation's transition + to a new NavigationTransition created in navigation's + relevant realm, with -

      -
      navigation type
      -
      navigationType
      +
      +
      navigation type
      +
      navigationType
      -
      from entry
      -
      fromNHE
      +
      from entry
      +
      fromNHE
      -
      destination
      -
      event's destination
      +
      destination
      +
      event's destination
      -
      committed promise
      -
      a new promise created in navigation's relevant realm
      +
      committed promise
      +
      a new promise created in navigation's relevant realm
      -
      finished promise
      -
      a new promise created in navigation's relevant realm
      -
      -
    11. +
      finished promise
      +
      a new promise created in navigation's relevant realm
      + + -
    12. -

      Mark as handled navigation's transition's finished promise.

      +
    13. +

      Mark as handled navigation's transition's finished promise.

      -

      See the discussion - about other finished promises to understand why this is done.

      -
    14. -
    15. Mark as handled navigation's transition's committed promise.

    16. -
    +

    See the discussion + about other finished promises to understand why this is done.

    +
  • Mark as handled navigation's transition's committed promise.

  • If event's navigation precommit handler - list is empty then commit event given apiMethodTracker.

  • - -
  • -

    Otherwise:

    - -
      -
    1. Let precommitController be a new NavigationPrecommitController - created in navigation's relevant realm, - whose event is - event.

    2. - -
    3. Let precommitPromisesList be an empty list.

    4. - -
    5. -

      For each handler of event's navigation precommit handler - list:

      + list is empty, then commit event given apiMethodTracker and + return false.

    6. -
        -
      1. Append the result of invoking handler with - « precommitController » to precommitPromisesList.

      2. -
      - +
    7. Let precommitController be a new NavigationPrecommitController + created in navigation's relevant realm, + whose event is + event.

    8. -
    9. Wait for all precommitPromisesList with the following success - steps: commit event given - apiMethodTracker, and the following failure step given reason: - process navigate event handler failure given event and - reason.

    10. -
    -
  • +
  • Let precommitPromisesList be an empty list.

  • -
  • If event's interception - state is "none", then return true.

  • +
  • For each handler of event's navigation precommit handler + list, append the result of invoking handler with + « precommitController » to precommitPromisesList.

  • + +
  • Wait for all precommitPromisesList with the following success + steps: commit event given + apiMethodTracker, and the following failure step given reason: + process navigate event handler failure given event and + reason.

  • Return false.

  • -

    To commit a navigate event given a NavigateEvent object +

    To commit an intercepted navigate event given a NavigateEvent object event and a navigation API method tracker apiMethodTracker:

    1. Assert: apiMethodTracker is not null.

    2. +
    3. Assert: event's interception state is "intercepted".

    4. +
    5. Let navigation be event's target.

    6. @@ -101965,12 +101951,6 @@ interface NavigationDestination { controller's signal is aborted, then return.

      -
    7. Let endResultIsSameDocument be true if event's interception state is not "none" or event's destination's is same document is true.

    8. -
    9. Prepare to run script given navigation's relevant settings object.

      @@ -101998,85 +101978,79 @@ interface NavigationDestination {
    -
  • -

    If event's interception - state is not "none":

    -
      -
    1. Set event's interception state to "committed".

    2. - -
    3. -

      Switch on event's navigationType:

      - -
      -
      "push"
      -
      "replace"
      -

      Run the URL and history update steps given event's - relevant global object's associated - Document and event's destination's URL, with serializedData set to event's classic history API state and - historyHandling set to event's navigationType.

      +
    4. Set event's interception state to "committed".

    5. -
      "reload"
      -

      Update the navigation API entries for a same-document navigation given - navigation, navigable's active - session history entry, and "reload".

      +
    6. +

      Switch on event's navigationType:

      -
      "traverse"
      -
      -
        -
      1. -

        Set navigation's suppress normal scroll restoration during ongoing - navigation to true.

        - -

        If event's scroll - behavior was set to "after-transition", then - scroll restoration will happen as part of finishing the relevant NavigateEvent. - Otherwise, there will be no scroll restoration. That is, no navigation which is - intercepted by intercept() goes through - the normal scroll restoration process; scroll restoration for such navigations is either - done manually, by the web developer, or is done after the transition.

        -
      2. +
        +
        "push"
        +
        "replace"
        +

        Run the URL and history update steps given event's + relevant global object's associated + Document and event's destination's URL, with serializedData set to event's classic history API state and + historyHandling set to event's navigationType.

        + +
        "reload"
        +

        Update the navigation API entries for a same-document navigation given + navigation, navigable's active + session history entry, and "reload".

        + +
        "traverse"
        +
        +
          +
        1. +

          Set navigation's suppress normal scroll restoration during ongoing + navigation to true.

          + +

          If event's scroll + behavior was set to "after-transition", then + scroll restoration will happen as part of finishing the relevant NavigateEvent. + Otherwise, there will be no scroll restoration. That is, no navigation which is + intercepted by intercept() goes through + the normal scroll restoration process; scroll restoration for such navigations is either + done manually, by the web developer, or is done after the transition.

          +
        2. -
        3. Let userInvolvement be "none".

        4. +
        5. Let userInvolvement be "none".

        6. -
        7. -

          If event's userInitiated is true, then set - userInvolvement to "activation".

          +
        8. +

          If event's userInitiated is true, then set + userInvolvement to "activation".

          -

          At this point after interception, it is not consequential whether the - activation was a result of browser UI.

          -
        9. +

          At this point after interception, it is not consequential whether the + activation was a result of browser UI.

          + -
        10. -

          Append the following session - history traversal steps to navigable's traversable navigable:

          +
        11. +

          Append the following session + history traversal steps to navigable's traversable navigable:

          -
            -
          1. Resume applying the traverse history step given event's - destination's entry's session history entry's step, - navigable's traversable navigable, and - userInvolvement.

          2. -
          -
        12. +
            +
          1. Resume applying the traverse history step given event's + destination's entry's session history entry's step, + navigable's traversable navigable, and + userInvolvement.

          -
        -
        - -
      +
    7. +
    + +
  • If navigation's transition @@ -102084,66 +102058,60 @@ interface NavigationDestination { data-x="concept-Navigation-transition">transition's committed promise with undefined.

  • -
  • -

    If endResultIsSameDocument is true:

    - -
      -
    1. Let promisesList be an empty list.

    2. +
    3. Let promisesList be an empty list.

    4. -
    5. Append apiMethodTracker's committed promise to - promisesList.

    6. +
    7. Append apiMethodTracker's committed promise to + promisesList.

    8. -
    9. -

      For each handler of event's navigation handler list:

      - -
        -
      1. Append the result of invoking handler with an empty - arguments list to promisesList.

      2. -
      -
    10. +
    11. +

      For each handler of event's navigation handler list:

      -
    12. -

      Wait for all of promisesList, with the following success steps:

      +
        +
      1. Append the result of invoking handler with an empty + arguments list to promisesList.

      2. +
      +
    13. -
        -
      1. If event's relevant global object is not fully - active, then abort these steps.

      2. +
      3. +

        Wait for all of promisesList, with the following success steps:

        -
      4. If event's abort - controller's signal is aborted, then abort these steps.

      5. +
          +
        1. If event's relevant global object is not fully + active, then abort these steps.

        2. -
        3. Assert: event equals navigation's ongoing - navigate event.

        4. +
        5. If event's abort + controller's signal is aborted, then abort these steps.

        6. -
        7. Set navigation's ongoing navigate event to null.

        8. +
        9. Assert: event equals navigation's ongoing + navigate event.

        10. -
        11. Finish event given - true.

        12. +
        13. Set navigation's ongoing navigate event to null.

        14. -
        15. Resolve the finished promise for apiMethodTracker.

        16. +
        17. Finish event given + true.

        18. -
        19. Fire an event named navigatesuccess at navigation.

        20. +
        21. Resolve the finished promise for apiMethodTracker.

        22. -
        23. If navigation's transition is not null, then resolve - navigation's transition's - finished promise with - undefined.

        24. +
        25. Fire an event named navigatesuccess at navigation.

        26. -
        27. Set navigation's transition to null.

        28. -
        +
      6. If navigation's transition is not null, then resolve + navigation's transition's + finished promise with + undefined.

      7. -

        and the following failure step given reason: process navigate event - handler failure given event and reason. - +

      8. Set navigation's transition to null.

      + +

      and the following failure step given reason: process navigate event + handler failure given event and reason.

    14. Clean up