Repository navigation
Initial spec for appHistory.navigate() and event.destination - #96
Conversation
| readonly attribute boolean canGoForward; | ||
|
|
||
| Promise<undefined> navigate(USVString url, optional AppHistoryNavigateOptions options = {}); | ||
| Promise<undefined> navigate(optional AppHistoryNavigateOptions options = {}); |
There was a problem hiding this comment.
Replace is not actually consulted for this overload. Perhaps we should use a fresh dictionary? This is actually observable in that the getter for replace will be called, whereas if we used a fresh dictionary it would not be called.
There was a problem hiding this comment.
I think this is ok for now, but we should think more about this.
Should options be required for the no-url variant? It seems nonsensical to call navigate() with 0-args.
There was a problem hiding this comment.
Web IDL requires that trailing dictionaries be optional, even if logically they are not optional. See whatwg/webidl#903.
Probably we should include a comment since this is confusing to people.
This has the impact of making appHistory.navigate("#foo", { state }) work instead of ignore the state (even when there's no navigate event handler)
| readonly attribute boolean canGoForward; | ||
|
|
||
| Promise<undefined> navigate(USVString url, optional AppHistoryNavigateOptions options = {}); | ||
| Promise<undefined> navigate(optional AppHistoryNavigateOptions options = {}); |
There was a problem hiding this comment.
I think this is ok for now, but we should think more about this.
Should options be required for the no-url variant? It seems nonsensical to call navigate() with 0-args.
|
Note to self: if the |
(This is in the broad sense of "navigation", which includes the navigate algorithm, history traversal, and pushState()/replaceState(). I.e., anything that would fire a navigate event, even if it doesn't.) Discussed in #96 (comment).
I.e., make sure that the rest of the algorithm doesn't think we called respondWith(). This is important for #96.
The behavior in https://chromium-review.googlesource.com/c/chromium/src/+/2822057 is to reject the promise, on the logic that detaching the window effectively aborts all navigations. |
|
Hmm, it seems we've run into whatwg/html#2621 ... |
|
Ah OK, it still works. Microtasks, unlike tasks, are not document-bound. |
…pondWith(Promise.reject())
(This is in the broad sense of "navigation", which includes the navigate algorithm, history traversal, and pushState()/replaceState(). I.e., anything that would fire a navigate event, even if it doesn't.) Discussed in #96 (comment).
# Conflicts: # spec.bs
|
Great, this is rebased on top of all the somewhat-related changes and is ready for re-review. |
# Conflicts: # spec.bs
Regarding #95, for now the promise never settles for cross-document navigations.
Regarding #97, for now I specified
url,sameDocument(not changing), andgetState().Preview | Diff