The navigate event intercept commit handler steps, given a Navigation
navigation, a NavigateEvent object event, and a navigation
API method tracker apiMethodTracker are as follows:
Let promisesList be an empty list.
For each handler of event's navigation handler list:
If promisesList's size is 0, then set promisesList to « a promise resolved with undefined ».
There is a subtle timing difference between how waiting for all schedules its success and failure steps when given zero promises
versus ≥1 promises. For most uses of waiting for all, this
does not matter. However, with this API, there are so many events and promise handlers which
could fire around the same time that the difference is pretty easily observable: it can cause
the event/promise handler sequence to vary. (Some of the events and promises involved include:
navigatesuccess / navigateerror, currententrychange, dispose, apiMethodTracker's promises, and the navigation.transition.finished promise.)
Wait for all of promisesList, with the following success steps:
If event's relevant global object is not fully active, then abort these steps.
If event's abort controller's signal is aborted, then abort these steps.
Assert: event equals navigation's ongoing navigate event.
Set navigation's ongoing navigate
event to null.
Finish event given true.
If apiMethodTracker is non-null, then resolve the finished promise for apiMethodTracker.
Fire an event named navigatesuccess at navigation.
If navigation's transition is not null, then resolve navigation's transition's finished promise with undefined.
Set navigation's transition to null.
and the following failure step given reason: process navigate event handler failure given event and reason.