diff --git a/source b/source index 6a8ff6c9eab..48cb296445c 100644 --- a/source +++ b/source @@ -100193,6 +100193,8 @@ const p2 = navigation.navigate(url2).finished;
  • Set navigation's transition to null.

  • + +
  • Resolve event's deferred commit cleanup promise.

  • @@ -100510,6 +100512,7 @@ interface NavigateEvent : Event { undefined intercept(optional NavigationInterceptOptions options = {}); undefined scroll(); + Promise<undefined> deferCommit(Promise<undefined> ready); }; dictionary NavigateEventInit : EventInit { @@ -100719,6 +100722,14 @@ callback NavigationInterceptHandler = InvalidStateError" DOMException.

    +
    event.scroll(Promise<undefined>)
    +
    Delays the committing of a same-origin cross-document navigation, without intercepting it as + a same-document navigation. The navigation will commit when promise passed as an argument is + resolved or rejected. This allows setting up some exit animation or performing some asynchronous + exit actions, without the commit aborting those actions in the middle. The returned Promise resolves after the last frame of the current document has + been rendered, or if the navigation was aborted, allowing the author to clean up any intermediate + state at that point.
    @@ -100738,6 +100749,12 @@ callback NavigationInterceptHandler = navigation handler list, a list of NavigationInterceptHandler callbacks, initially empty.

    +

    Each NavigateEvent has a deferred commit promise list, a + list of promise objects, initially empty.

    + +

    Each NavigateEvent has a deferred commit cleanup promise, a promise + object, initially a new promise.

    +

    Each NavigateEvent has a focus reset behavior, a NavigationFocusReset-or-null, initially null.

    @@ -100771,10 +100788,10 @@ callback NavigationInterceptHandler = downloadRequest, info, hasUAVisualTransition, and - sourceElement attributes - must return the values they are initialized to.

    + data-x="dom-NavigateEvent-hasUAVisualTransition">hasUAVisualTransition, and sourceElement attributes must return the + values they are initialized to.

    @@ -100883,6 +100900,42 @@ callback NavigationInterceptHandler = deferCommit(readyPromise) method + steps are:

    + +
      +
    1. Perform shared checks given + this.

    2. + +
    3. If this's canIntercept + attribute was initialized to false, then throw a "SecurityError" + DOMException.

    4. + +
    5. If this's dispatch flag is unset, then throw an + "InvalidStateError" DOMException.

    6. + +
    7. If this's interception state is not "none", then throw an "InvalidStateError" + DOMException.

    8. + +
    9. Append readyPromise to this's + deferred commit promise list.

    10. + +
    11. Let cleanupPromise be a new promise in this's relevant realm.

    12. + +
    13. Wait for all « readyPromise, this's deferred + commit cleanup promise », with the following as both the success and failure step: resolve + cleanupPromise.

    14. + +
    15. Return cleanupPromise.

    16. +
    + +
    +

    To perform shared checks for a NavigateEvent event:

    @@ -101278,7 +101331,8 @@ interface NavigationDestination { state-or-null classicHistoryAPIState (default null), and an optional navigation API method tracker-or-null apiMethodTracker:

    + data-x="fire-navigate-prr-api-method-tracker">apiMethodTracker (default + null):

    1. Let document be navigation's relevant global object's NavigationDestination { transition, to display a cached rendered state of the document's latest entry, was done by the user agent. Otherwise, initialize it to false.

    2. +
    3. Let destinationDocument be.

    4. +
    5. Initialize event's sourceElement to sourceElement.

    6. @@ -106387,6 +106443,10 @@ location.href = '#foo'; data-x="navigate-fragid">navigate to a fragment path.

      +
    7. Let deferringCommit be true if navigation's ongoing navigate event's deferred commit promise list + is non-empty; Otherwise false.

    8. +
    9. If sourceDocument is navigable's container document, then reserve deferred fetch quota for navigable's container given @@ -106575,8 +106635,9 @@ location.href = '#foo'; data-x="dom-navigationtimingtype-navigate">navigate", sourceSnapshotParams, targetSnapshotParams, userInvolvement, navigationId, navigationParams, cspNavigationType, with allowPOST set to true and completionSteps set to the following + data-x="attempt-to-populate-allow-post">allowPOST set to true, deferCommit set to deferringCommit, + and completionSteps set to the following step:

        @@ -107953,8 +108014,9 @@ location.href = '#foo'; (default null), an optional navigation params-or-null navigationParams (default null), an optional string cspNavigationType (default "other"), an optional boolean allowPOST (default false), and optional - algorithm steps allowPOST (default false), an optional + boolean deferCommit (default + false), and optional algorithm steps completionSteps (default an empty algorithm):

        @@ -108036,14 +108098,14 @@ location.href = '#foo';
    10. -
    11. -

      Queue a global task on the navigation and traversal task source, - given navigable's active window, to run these steps:

      +
    12. +

      Let processNavigateResponse be to + queue a global task on the navigation and traversal task source, given + navigable's active window, to run these steps:

      1. If navigable's ongoing navigation no longer equals navigationId, then run completionSteps and abort these steps.

      2. -
      3. Let saveExtraDocumentState be true.

        @@ -108265,6 +108327,19 @@ location.href = '#foo';
      4. Run completionSteps.

    13. + +
    14. +

      If deferringCommit is true, then defer navigation commit given + navigable, navigationId, and the following steps:

      + +
        +
      1. Call processNavigateResponse.

      2. + +
      3. Set processNavigateResponse to an empty algorithm.

      4. +
      +
    15. + +
    16. Otherwise, call processNavigateResponse.

    @@ -109062,6 +109137,36 @@ location.href = '#foo'; +
    +

    To defer navigation commit given a navigable navigable, a + navigation ID navigationID, and an algorithm proceed:

    + +
      +
    1. Let document be navigable's active + document.

    2. + +
    3. +

      Queue a task on the DOM manipulation task source given + document's relevant global object to run the steps:

      + +
        +
      1. If navigable ongoing navigation is not navigationID, + then call proceed and abort these steps.

      2. + +
      3. Let event be document's relevant global object's + navigation API's ongoing navigate event.

      4. + +
      5. Add proceed to event's signal.

      6. + +
      7. Wait for all event's deferred commit promise list, + with proceed as both the success and failure steps.

      8. +
      +
    4. +
    +
    +

    An element has a browsing context scope origin if its Document's node navigable is a top-level traversable or if all of its