diff --git a/source b/source index 601171fa244..f79b92199fb 100644 --- a/source +++ b/source @@ -98149,16 +98149,16 @@ interface History {
Let navigation be history's relevant global object's navigation API.
Let continue be the result of firing a push/replace/reload navigate event at
- navigation with navigationType set to
- historyHandling, isSameDocument set
- to true, destinationURL set to
- newURL, and
Set historyHandling to the result of firing a push/replace/reload navigate event at navigation with navigationType set to historyHandling,
+ isSameDocument set to true, destinationURL set to newURL, and classicHistoryAPIState set to
serializedData.
If continue is false, then return.
+If historyHandling is null, then return.
Run the URL and history update steps given document and newURL, with serializedData set to @@ -98855,12 +98855,15 @@ enum NavigationHistoryBehavior { index to the result of getting the navigation API entry index of reactivatedSHE within navigation.
Flush navigation API restore callbacks given navigation.
Queue a global task on the navigation and traversal task source given navigation's relevant global object to run the following steps:
For each disposedNHE of oldNHEs:
@@ -100370,6 +100373,8 @@ const p2 = navigation.navigate(url2).finished;ErrorEvent, with additional attributes initialized according to
errorInfo.Flush navigation API restore callbacks given navigation.
If navigation's transition is null, then return.
Let navigation be navigable's active window's navigation API.
Let event be navigation's ongoing navigate event.
While navigation's ongoing navigate event is not null:
event.navigationTypeDOMException.
+
+ event.deferPageSwap(NavigationDeferPageSwapOptions options)Delays finalizing a same-origin cross-document navigation, without intercepting it as + a same-document navigation. The navigation will continue to the new page once handlers passed to + this method are settled. This allows setting up some exit animation, or performing some + asynchronous exit actions, without the page deactivation aborting those actions in the + middle.
+ +Like intercept(), this method only works
+ on same-origin non-traverse navigations.
Deferring and intercepting cannot co-exist on the same NavigateEvent. Calling
+ one after the other would throw an "InvalidStateError"
+ DOMException when the latter is called.
All the handler option
+ passed by succesful calls to this methods are called in order, and once their returned promises
+ are resolved, the navigation can proceed to swap the page.
The historyChange
+ option controls whether the URL and history change take place immediately, or at page swap.
+ A value of "after-transition"
+ would keep the current history state until the navigation is ready to commit, while a value of
+ "immediate" would
+ change the history immediately. The default value is "immediate", which creates a
+ more consistent experience with browser UI, such as pressing the back button immediately after
+ the transition begins.
NavigationInterceptHandler callbacks, initially empty.
+ Each NavigateEvent has a defer page-swap handler list, a
+ list of NavigationDeferPageSwapHandler callbacks, initially empty.
Each NavigateEvent has a page-swap history
+ change behavior, a NavigationDeferPageSwapHistoryChange, initially "immediate".
Each NavigateEvent has a focus
reset behavior, a NavigationFocusReset-or-null, initially null.
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.
DOMException.
+ If this's defer page-swap handler list
+ is not empty, then throw an
+ "InvalidStateError" DOMException.
The same navigation cannot be both intercepted and deferred.
+If options["precommitHandler"] NavigationInterceptHandler = deferPageSwap(options) method
+ steps are:
Perform shared checks given + this.
If this's canIntercept
+ attribute was initialized to false, then throw a "SecurityError"
+ DOMException.
If this's dispatch flag is unset, then throw an
+ "InvalidStateError" DOMException.
If this's interception state is not "none", then throw an "InvalidStateError"
+ DOMException.
The same navigation cannot be both intercepted and deferred.
+Let historyChange be options["historyChange"] if exists, otherwise "immediate".
If this's defer page-swap handler list
+ is not empty and historyChange is not
+ event's page-swap history change
+ behavior, then throw an "InvalidStateError"
+ DOMException.
Set event's + page-swap history + change behavior to historyChange.
Append handler to this's + defer page-swap handler + list.
To perform shared checks for a
NavigateEvent event:
deferControlller.addRestoreCallback(NavigationDeferPageSwapRestoreHandler handler)Adds a callback handler that will be called when the state needs to be restored + to the pre-navigation conditions. The handler is called if the navigation is aborted, or if the + navigation succeeded and the page is subsequently restored from + back/forward cache.
A NavigationDeferPageSwapController has a NavigateEvent event.
The addRestoreCallback(callback)
+ method steps are:
Let event be this's event.
Perform shared checks given + event.
If event's relevant global object's
+ navigation API's ongoing navigate event is not event, then throw an
+ "InvalidStateError" DOMException.
Append callback to event's + relevant global object's navigation + API's restore callback + list.
NavigationDestination interface[Exposed=Window]
@@ -101490,7 +101656,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):
Let document be navigation's relevant global object's NavigationDestination {
Set destination's is
same document to isSameDocument. Return the result of performing the inner Perform the inner navigate event firing algorithm given
navigation, navigationType, event, destination,
userInvolvement, sourceElement, formDataEntryList, null, and
- apiMethodTracker.
If event's defer page-swap handler list + is empty, return historyHandling.
Let deferControlller be a new NavigationDeferPageSwapController
+ created in navigation's relevant realm,
+ whose event is
+ event.
Let deferPromisesList be an empty list.
Let navigationID be navigable's + ongoing navigation.
For each handler of event's navigation defer page-swap handler + list, append the result of invoking handler with + « deferControlller » to deferPromisesList.
Wait for all deferPromisesList, with the following as both the + success and failure step: proceed with navigation after deferred commit given + navigable and navigationID.
If event's page-swap history change
+ behavior is "after-transition",
+ or if navigationType is "reload",
+ return navigationType.
Run the URL and history update steps given document and + newURL, with serializedData set to + serlialized state and historyHandling set to + navigationType.
Return "replace".
Let continue be the result of firing a push/replace/reload navigate
event at navigation with navigationType set to historyHandling,
@@ -106562,7 +106767,7 @@ location.href = '#foo';
data-x="fire-navigate-prr-api-method-tracker">apiMethodTracker set to
apiMethodTracker.
If continue is false, then return.
+If historyHandling is null, then return.
It is possible for navigations with userInvolvement of "
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,
+ and completionSteps set to the following
step:
If navigationAPIState is not null, then set destinationNavigationAPIState to navigationAPIState.
Let continue be the result of firing a push/replace/reload navigate event at
- navigation with navigationType set to
- historyHandling, isSameDocument set
- to true, userInvolvement set to
- userInvolvement, sourceElement set
- to sourceElement, destinationURL
- set to url, and
Set historyHandling to the result of firing a push/replace/reload navigate event at navigation with navigationType set to historyHandling,
+ isSameDocument set to true, userInvolvement set to userInvolvement,
+ sourceElement set to sourceElement, destinationURL set to url, and navigationAPIState set to
destinationNavigationAPIState.
If continue is false, then return.
+If historyHandling is null, then return.
Let historyEntry be a new session history entry, with
@@ -107838,13 +108043,22 @@ location.href = '#foo'; -Each navigable has a commit navigation steps, which is null or an algorithm + accepting nothing, initially null.
+ +Each navigable has a boolean deferring page swap, initially false.
+ +Each Navigation has an associated restore callback list, a list of
+ algorithms, initially empty.
To set the ongoing navigation for a navigable navigable to newValue:
@@ -107853,6 +108067,9 @@ location.href = '#foo';If navigable's ongoing navigation is equal to newValue, then return.
Proceed with navigation after deferred commit given navigable + and newValue.
Inform the navigation API about aborting navigation given navigable.
To proceed with navigation after deferred commit given a navigable navigable + and a navigation ID navigationID, queue a global task on the navigation and traversal task source of navigable's active + window to run the steps:
+ +Set navigable's deferring page swap to false.
If navigable's commit navigation steps is not null, then call + navigable's commit navigation steps given + navigationID.
Set navigable's commit navigation steps to null.
To flush navigation API restore callbacks for a Navigation object
+ navigation:
Set callbacks to navigation's restore callback list.
Set navigation's restore callback list to an empty + list.
For each restoreCallback in + callbacks, call restoreCallback.
If navigationAPIState is not null, then set destinationNavigationAPIState to navigationAPIState.
Let continue be the result of firing a push/replace/reload navigate
event at navigation with navigationType set to "
data-x="fire-navigate-prr-api-method-tracker">apiMethodTracker set to
apiMethodTracker.
If continue is false, then return.
If eventResult is null, then return.
other"), an optional boolean allowPOST (default false), and optional
- algorithm steps allowPOST (default false), and optional algorithm steps completionSteps (default an empty
algorithm):
@@ -108221,13 +108469,19 @@ location.href = '#foo';
- Queue a global task on the navigation and traversal task source, - given navigable's active window, to run these steps:
+Let processNavigateResponse + be the following steps given a navigation ID navigationToResume:
If navigable's ongoing navigation no longer equals - navigationId, then run completionSteps and abort these steps.
If navigationToResume no longer equals navigationId, then run + completionSteps and abort these steps.
Set navigable's commit navigation steps to null.
If navigable's deferring page swap is true, + then set navigable's commit navigation steps to + processNavigateResponse and abort these steps.
Let saveExtraDocumentState be true.
@@ -108450,6 +108704,10 @@ location.href = '#foo';Run completionSteps.
Queue a global task on the navigation and + traversal task source of navigable's active + window to call processNavigateResponse.