appHistory transitionWhile() custom start/stop notifications
The appHistory prototype introduces a way for web developers to
intercept a navigation and cause it to be treated as an *async*
same-document navigation. AppHistoryNavigateEvent has a
function called transitionWhile() that takes a promise and considers
the navigation complete when the promise is resolved.
In order to have a transitionWhile()-intercepted navigation be a full
fledged navigation, the browser UI should show a navigation in process
until the promise is resolved. This requires:
1. Making same-documents generally use the same start/stop
navigation tracking as cross-document navigations in blink.
2. Special-casing transitionWhile() to not immediately complete like
other same-document navigations, and instead completing when the
promise resolves.
3. Adding logic to FrameLoader::DidFinishNavigation() to ensure that
it does not erroneously complete while AppHistory thinks a
navigation is still in progress.
4. Browser-side special-casing to ensure that the browser UI
shows the navigation-in-progress UI elements for transitionWhile().
Currently, it only does this for cross-document navigations.
Bug: 1241202
Change-Id: I3fccebded69a74c9c8679501755acb531fa05841
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3049791
Reviewed-by: Sreeja Kamishetty <sreejakshetty@chromium.org>
Reviewed-by: Charles Reis <creis@chromium.org>
Reviewed-by: Rakina Zata Amni <rakina@chromium.org>
Reviewed-by: Domenic Denicola <domenic@chromium.org>
Reviewed-by: Alexander Timin <altimin@chromium.org>
Commit-Queue: Nate Chapin <japhet@chromium.org>
Cr-Commit-Position: refs/heads/main@{#950735}
diff --git a/app-history/navigate/navigate-transitionWhile-reject-event-order.html b/app-history/navigate/navigate-transitionWhile-reject-event-order.html
index 22d2ef9..ca73016 100644
--- a/app-history/navigate/navigate-transitionWhile-reject-event-order.html
+++ b/app-history/navigate/navigate-transitionWhile-reject-event-order.html
@@ -5,7 +5,7 @@
async_test(t => {
let events = [];
function finish() {
- assert_array_equals(events, ["onnavigate", "committed promisefulfilled", "onnavigateerror", "finished promiserejected"]);
+ assert_array_equals(events, ["onnavigate", "committed promisefulfilled", "onnavigateerror", "finished promiserejected", "onhashchange", "onpopstate"]);
t.done();
}