-
Notifications
You must be signed in to change notification settings - Fork 2.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Expose information about last activation/cross-document navigation #9760
Comments
An alternative API could be more consistent with the navigation API, specifically [ interface ActivationInfo {
/* push/replace/traverse/reload*/
readonly attribute NavigationType navigationType;
readonly attribute NavigationDestination? previous;
readonly attribute NavigationDestination current;
}
partial interface Document {
readonly attribute ActivationInfo activationInfo;
} |
A few questions for the proposal above, I like the direction its headed!
@jeremyroman for the pre-rendering stuff. |
You have this data when you activate the page, but afterwards this info might change with soft navigations. It's an optional convenience. If we don't want it we don't have to have it.
I think it would work to have it be the previous page, and change on |
+1 to everything above. |
This direction seems good to me. A few minor surface concerns:
// after a cross-document back traversal, either bfcache or not:
console.assert(document.activationInfo.previous === navigation.entries()[navigation.currentEntry.index + 1]);
// always the case on page load, although it'd change after a same-document navigation of any sort:
console.assert(navigation.currentEntry === document.activationInfo.current); It's an interesting question whether we want to expose the "activation" vocabulary in the API, or how "activation" vs. "navigation" impacts things. Clearly, we want to expose bfcache reactivation. But that is a navigation, too. (Specifically a cross-document traversal.) I'm not sure I see how prerender activation vs. the original navigation that started the prerender would play into this API. Given the proposals so far, nothing seems to expose this difference. Were you thinking this would be null during prerendering? That seems bad, as it would make it unnecessarily difficult to make your page pre-renderable. (You'd need to move anything that accesses this property until after So, I'd rather phrase this in terms of something like "this cross-document navigation". And maybe place it under For the For the |
I can see that. I went with
Perhaps
Thinking it would be the prerender navigation during prerendering, and the activation navigation on
Sounds good. Especially if we expose the prerendering navigation.
Not sure about the word "load" because when we activate from bfcache/prerender the document is already "loaded" (as in the So something like: interface CrossDocumentNavigation {
readonly attribute NavigationHistoryEntry entry;
readonly attribute NavigationHistoryEntry? from;
NavigationType type;
};
partial interface Navigation {
attribute CrossDocumentNavigation crossDocument;
} The following doesn't seem too bad: navigation.crossDocument.entry;
navigation.crossDocument.from;
navigation.crossDocument.type; |
We've so far been treating prerendering activation as more of a "visual" event, not an actual navigation. So I think it could stay the same across both.
Looks pretty good to me! The |
How would that work for the view-transitions case, and potentially other cases, if there were soft navigations in the initiating page? We want |
Hmm, I'm not sure I understand the problem. Is this the scenario you're talking about?
|
More like this:
I don't totally buy that prerender activation is merely a visibility thing. It also tinkers with the history, and from the point of view of the old page it's a proper navigation. |
I see! That is indeed tricky. OK, now I understand why you wanted to focus on activation, and maybe we should reconsider the naming in light of that... I guess there is also the following tricky case:
(And you can mix in your example too, so that So I can see the following possible paths:
Any other possibilities? Only (4) or (5) makes it easy for prerendered pages to mostly-ignore the fact that they're being prerendered. At the cost that they might be slightly buggy (for (4)), or delayed (for (5)). The others, to varying degrees, can lead to unexpected Despite that, I'm leaning toward (2) or (3) as the most conceptually clean. Maybe this is just one of those things which we can't make transparent to prerendered pages. For most pages, which are not prerendered, (1), (2), or (4) are most convenient. (3) is reasonable but could be a bit confusing, in that you'd get two properties with the same value and so people might write their code sloppily not thinking about which one is actually correct for their potential prerendering future. If we go down (2) or (3), then maybe it's fine to make developers learn about the activation concept after all? |
That's not bad
Yes! To expose it only in events where it makes sense, like in the
I like (2) if we don't go the event route.
Sure. Let's see if we're going with that. I definitely prefer (2) to the rest, because it's the simplest in the non-prerender case. |
Hmm, yeah, I can see how only exposing it in events is simplest. That does prevent us from accomplishing the other use cases (around the loading spinner and detecting stops during the navigation) in WICG/navigation-api#256 (comment), at least in the same API. Maybe that's fine? But it'd be kind of a shame if we later decide they should have been together in the same API. |
What's wrong with listening to |
@domenic Oh I see you're talking about the use cases in the comment rather than the original issue. Out of these use cases, several are already covered by existing events like Perhaps at some point we could have an activation-info thing that's actually for the initial load (not including activate/restore) with the added things like controlling the load indicator. |
One use-case for exposing it sooner would be tagging appropriate resources and DOM nodes as render-blocking. By design Out of the options Domenic mentioned, I like 4. The browser automagically updates the value and if needed later, we can add an event to notify when the value changes. |
Yea I see the point in this use case. (4) handles it pretty well, and perhaps (2) is confusing when prerendering. |
Note that So I think:
and |
How can |
A prerender activation after a soft navigation in the prerendered page would be to the lastest entry. |
OK, so it's not supposed to represent the original cross-document navigation. So I think I'd prefer the properties updating, instead of the object; since they can vary independently, that seems more clear. |
Right, it's the most recent cross document navigation rather than the original one. If "activation" doesn't feel 100%, perhaps we should call this a page transition? We already have a So if we don't like
I'm OK with that. |
I'm good with something related to "activation". I apologize for not realizing from the start that this would need to be more connected to activation, and we couldn't just hide it under the concept of "navigation" or "cross-document navigation".
|
Works for me! |
@zcorpan how do you feel about this? Do we need a new standards position on this or is the one for navigation API enough? |
What will |
It would be |
I'd be curious to hear @jeremyroman @domenic's take on this. It could put pre-render at a disadvantage. For example, a page could set up parser blocking only when there is a morph transition which requires a DOM node on the other side. Like list->details page needs that but home->details page doesn't. A pre-rendered page won't be able to do that. Again this only matters if the delay between starting pre-rendering and activation is small but that's the direction we seem to be headed in. The fact that activator page's URL can change is a concern but seems reasonable to start the pre-rendered page with the value from the Document that initiated the pre-render. And update if that changes. We're already adding the concept that this value can update for BFCache. |
A prerendered page can do this at Note that the prerendered page also has access to the |
Initial discussion: whatwg/html#9760 Draft spec PR: whatwg/html#9856 Bug: 1492932 Change-Id: I2e090a8366906e4cb6778893ad9ffdca18d6ec37
Initial discussion: whatwg/html#9760 Draft spec PR: whatwg/html#9856 Bug: 1492932 Change-Id: I2e090a8366906e4cb6778893ad9ffdca18d6ec37
NavigationActivation is a new object (exposed as `navigation.activation`). It is updated when a new Document is "activated": initial Document creation, restore from bfcache, or (in a future CL) prerender activation. It has three pieces of state: * `activation.entry`: The current NavigationHistoryEntry at the time of activation. * `activation.from`: The current NaivgationHistoryEntry immediately before activation (i.e., the entry we came from). This will be null if the navigation was cross-origin. * `activation.navigationType`: The navigationType ('push', 'replace', 'reload', or 'traverse') of the navigation that activated the current Document. Note that `entry` or `from` may be a NavigationHistoryEntry that is no longer present in `navigation.entries()` (e.g., when doing a replace navigation, `activation.from` will be the replaced entry). In that case, the entry will remain visible, but because it is a "disposed" entry, its index will be -1 and attempting to `navigation.traverseTo()` its key will be rejected. Initial discussion: whatwg/html#9760 Draft spec PR: whatwg/html#9856 Bug: 1492932 Change-Id: I2e090a8366906e4cb6778893ad9ffdca18d6ec37
NavigationActivation is a new object (exposed as `navigation.activation`). It is updated when a new Document is "activated": initial Document creation, restore from bfcache, or (in a future CL) prerender activation. It has three pieces of state: * `activation.entry`: The current NavigationHistoryEntry at the time of activation. * `activation.from`: The current NaivgationHistoryEntry immediately before activation (i.e., the entry we came from). This will be null if the navigation was cross-origin. * `activation.navigationType`: The navigationType ('push', 'replace', 'reload', or 'traverse') of the navigation that activated the current Document. Note that `entry` or `from` may be a NavigationHistoryEntry that is no longer present in `navigation.entries()` (e.g., when doing a replace navigation, `activation.from` will be the replaced entry). In that case, the entry will remain visible, but because it is a "disposed" entry, its index will be -1 and attempting to `navigation.traverseTo()` its key will be rejected. Initial discussion: whatwg/html#9760 Draft spec PR: whatwg/html#9856 Bug: 1492932 Change-Id: I2e090a8366906e4cb6778893ad9ffdca18d6ec37
NavigationActivation is a new object (exposed as `navigation.activation`). It is updated when a new Document is "activated": initial Document creation, restore from bfcache, or (in a future CL) prerender activation. It has three pieces of state: * `activation.entry`: The current NavigationHistoryEntry at the time of activation. * `activation.from`: The current NaivgationHistoryEntry immediately before activation (i.e., the entry we came from). This will be null if the navigation was cross-origin, or if the previous entry was not in the same-origin contiguous region of the back/forward list that is available in `navigation.entries()`. * `activation.navigationType`: The navigationType ('push', 'replace', 'reload', or 'traverse') of the navigation that activated the current Document. Note that `entry` or `from` may be a NavigationHistoryEntry that is no longer present in `navigation.entries()` (e.g., when doing a replace navigation, `activation.from` will be the replaced entry). In that case, the entry will remain visible, but because it is a "disposed" entry, its index will be -1 and attempting to `navigation.traverseTo()` its key will be rejected. Initial discussion: whatwg/html#9760 Draft spec PR: whatwg/html#9856 Bug: 1492932 Change-Id: I2e090a8366906e4cb6778893ad9ffdca18d6ec37
NavigationActivation is a new object (exposed as `navigation.activation`). It is updated when a new Document is "activated": initial Document creation, restore from bfcache, or (in a future CL) prerender activation. It has three pieces of state: * `activation.entry`: The current NavigationHistoryEntry at the time of activation. * `activation.from`: The current NavigationHistoryEntry immediately before activation (i.e., the entry we came from). This will be null if the navigation was cross-origin, or if the previous entry was not in the same-origin contiguous region of the back/forward list that is available in `navigation.entries()`. * `activation.navigationType`: The navigationType ('push', 'replace', 'reload', or 'traverse') of the navigation that activated the current Document. Note that `entry` or `from` may be a NavigationHistoryEntry that is no longer present in `navigation.entries()` (e.g., when doing a replace navigation, `activation.from` will be the replaced entry). In that case, the entry will remain visible, but because it is a "disposed" entry, its index will be -1 and attempting to `navigation.traverseTo()` its key will be rejected. Initial discussion: whatwg/html#9760 Draft spec PR: whatwg/html#9856 Bug: 1492932 Change-Id: I2e090a8366906e4cb6778893ad9ffdca18d6ec37
NavigationActivation is a new object (exposed as `navigation.activation`). It is updated when a new Document is "activated": initial Document creation, restore from bfcache, or (in a future CL) prerender activation. It has three pieces of state: * `activation.entry`: The current NavigationHistoryEntry at the time of activation. * `activation.from`: The current NavigationHistoryEntry immediately before activation (i.e., the entry we came from). This will be null if the navigation was cross-origin, or if the previous entry was not in the same-origin contiguous region of the back/forward list that is available in `navigation.entries()`. * `activation.navigationType`: The navigationType ('push', 'replace', 'reload', or 'traverse') of the navigation that activated the current Document. Note that `entry` or `from` may be a NavigationHistoryEntry that is no longer present in `navigation.entries()` (e.g., when doing a replace navigation, `activation.from` will be the replaced entry). In that case, the entry will remain visible, but because it is a "disposed" entry, its index will be -1 and attempting to `navigation.traverseTo()` its key will be rejected. Initial discussion: whatwg/html#9760 Draft spec PR: whatwg/html#9856 Bug: 1492932 Change-Id: I2e090a8366906e4cb6778893ad9ffdca18d6ec37
NavigationActivation is a new object (exposed as `navigation.activation`). It is updated when a new Document is "activated": initial Document creation, restore from bfcache, or (in a future CL) prerender activation. It has three pieces of state: * `activation.entry`: The current NavigationHistoryEntry at the time of activation. * `activation.from`: The current NavigationHistoryEntry immediately before activation (i.e., the entry we came from). This will be null if the navigation was cross-origin, or if the previous entry was not in the same-origin contiguous region of the back/forward list that is available in `navigation.entries()`. * `activation.navigationType`: The navigationType ('push', 'replace', 'reload', or 'traverse') of the navigation that activated the current Document. Note that `entry` or `from` may be a NavigationHistoryEntry that is no longer present in `navigation.entries()` (e.g., when doing a replace navigation, `activation.from` will be the replaced entry). In that case, the entry will remain visible, but because it is a "disposed" entry, its index will be -1 and attempting to `navigation.traverseTo()` its key will be rejected. Initial discussion: whatwg/html#9760 Draft spec PR: whatwg/html#9856 Bug: 1492932 Change-Id: I2e090a8366906e4cb6778893ad9ffdca18d6ec37
NavigationActivation is a new object (exposed as `navigation.activation`). It is updated when a new Document is "activated": initial Document creation, restore from bfcache, or (in a future CL) prerender activation. It has three pieces of state: * `activation.entry`: The current NavigationHistoryEntry at the time of activation. * `activation.from`: The current NavigationHistoryEntry immediately before activation (i.e., the entry we came from). This will be null if the navigation was cross-origin, or if the previous entry was not in the same-origin contiguous region of the back/forward list that is available in `navigation.entries()`. * `activation.navigationType`: The navigationType ('push', 'replace', 'reload', or 'traverse') of the navigation that activated the current Document. Note that `entry` or `from` may be a NavigationHistoryEntry that is no longer present in `navigation.entries()` (e.g., when doing a replace navigation, `activation.from` will be the replaced entry). In that case, the entry will remain visible, but because it is a "disposed" entry, its index will be -1 and attempting to `navigation.traverseTo()` its key will be rejected. Initial discussion: whatwg/html#9760 Draft spec PR: whatwg/html#9856 I2p: https://groups.google.com/a/chromium.org/g/blink-dev/c/EfqxeH3Iwh4 Bug: 1492932 Change-Id: I2e090a8366906e4cb6778893ad9ffdca18d6ec37
In prototyping an interesting case came up. After the replace navigation from the initial about:blank, what should Currently in #9856 we construct a new
However, generally the philosophy of the navigation API is that it "doesn't work" on the initial about:blank, and tries not to expose the initial about:blank's existence. So, I am wondering if instead we want to censor it to |
NavigationActivation is a new object (exposed as `navigation.activation`). It is updated when a new Document is "activated": initial Document creation, restore from bfcache, or (in a future CL) prerender activation. It has three pieces of state: * `activation.entry`: The current NavigationHistoryEntry at the time of activation. * `activation.from`: The current NavigationHistoryEntry immediately before activation (i.e., the entry we came from). This will be null if the navigation was cross-origin, or if the previous entry was not in the same-origin contiguous region of the back/forward list that is available in `navigation.entries()`. * `activation.navigationType`: The navigationType ('push', 'replace', 'reload', or 'traverse') of the navigation that activated the current Document. Note that `entry` or `from` may be a NavigationHistoryEntry that is no longer present in `navigation.entries()` (e.g., when doing a replace navigation, `activation.from` will be the replaced entry). In that case, the entry will remain visible, but because it is a "disposed" entry, its index will be -1 and attempting to `navigation.traverseTo()` its key will be rejected. Initial discussion: whatwg/html#9760 Draft spec PR: whatwg/html#9856 I2p: https://groups.google.com/a/chromium.org/g/blink-dev/c/EfqxeH3Iwh4 Bug: 1492932 Change-Id: I2e090a8366906e4cb6778893ad9ffdca18d6ec37 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4990011 Reviewed-by: Domenic Denicola <domenic@chromium.org> Commit-Queue: Nate Chapin <japhet@chromium.org> Cr-Commit-Position: refs/heads/main@{#1220983}
NavigationActivation is a new object (exposed as `navigation.activation`). It is updated when a new Document is "activated": initial Document creation, restore from bfcache, or (in a future CL) prerender activation. It has three pieces of state: * `activation.entry`: The current NavigationHistoryEntry at the time of activation. * `activation.from`: The current NavigationHistoryEntry immediately before activation (i.e., the entry we came from). This will be null if the navigation was cross-origin, or if the previous entry was not in the same-origin contiguous region of the back/forward list that is available in `navigation.entries()`. * `activation.navigationType`: The navigationType ('push', 'replace', 'reload', or 'traverse') of the navigation that activated the current Document. Note that `entry` or `from` may be a NavigationHistoryEntry that is no longer present in `navigation.entries()` (e.g., when doing a replace navigation, `activation.from` will be the replaced entry). In that case, the entry will remain visible, but because it is a "disposed" entry, its index will be -1 and attempting to `navigation.traverseTo()` its key will be rejected. Initial discussion: whatwg/html#9760 Draft spec PR: whatwg/html#9856 I2p: https://groups.google.com/a/chromium.org/g/blink-dev/c/EfqxeH3Iwh4 Bug: 1492932 Change-Id: I2e090a8366906e4cb6778893ad9ffdca18d6ec37 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4990011 Reviewed-by: Domenic Denicola <domenic@chromium.org> Commit-Queue: Nate Chapin <japhet@chromium.org> Cr-Commit-Position: refs/heads/main@{#1220983}
NavigationActivation is a new object (exposed as `navigation.activation`). It is updated when a new Document is "activated": initial Document creation, restore from bfcache, or (in a future CL) prerender activation. It has three pieces of state: * `activation.entry`: The current NavigationHistoryEntry at the time of activation. * `activation.from`: The current NavigationHistoryEntry immediately before activation (i.e., the entry we came from). This will be null if the navigation was cross-origin, or if the previous entry was not in the same-origin contiguous region of the back/forward list that is available in `navigation.entries()`. * `activation.navigationType`: The navigationType ('push', 'replace', 'reload', or 'traverse') of the navigation that activated the current Document. Note that `entry` or `from` may be a NavigationHistoryEntry that is no longer present in `navigation.entries()` (e.g., when doing a replace navigation, `activation.from` will be the replaced entry). In that case, the entry will remain visible, but because it is a "disposed" entry, its index will be -1 and attempting to `navigation.traverseTo()` its key will be rejected. Initial discussion: whatwg/html#9760 Draft spec PR: whatwg/html#9856 I2p: https://groups.google.com/a/chromium.org/g/blink-dev/c/EfqxeH3Iwh4 Bug: 1492932 Change-Id: I2e090a8366906e4cb6778893ad9ffdca18d6ec37 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4990011 Reviewed-by: Domenic Denicola <domenic@chromium.org> Commit-Queue: Nate Chapin <japhet@chromium.org> Cr-Commit-Position: refs/heads/main@{#1220983} Co-authored-by: Nate Chapin <japhet@chromium.org>
I assumed a navigation from about:blank would be considered cross-origin. Is that not how the navigation API treats it? For the VT use-case this treatment would work because there can't possibly be a transition when navigating away from about:blank. |
Not necessarily. The initial about:blank inherits the origin from its creator, and its creator might be same-origin to the page that replaces the initial about:blank.
The navigation API currently doesn't expose it one way or another, since you can't observe replaced entries, and the navigation API itself is disabled while on the initial about:blank. So this feature is the first time we'd have to answer the question. |
Ah TIL. In that case your statement here sounds good to me: "I am wondering if instead we want to censor it to |
I'm OK with not exposing the initial I think in general we should allow orphan entries for same-origin navigations rather than special-case @domenic WDYT? |
I'm OK with that. |
Revised the PR. |
Automatic update from web-platform-tests NavigationActivation prototype (#42873) NavigationActivation is a new object (exposed as `navigation.activation`). It is updated when a new Document is "activated": initial Document creation, restore from bfcache, or (in a future CL) prerender activation. It has three pieces of state: * `activation.entry`: The current NavigationHistoryEntry at the time of activation. * `activation.from`: The current NavigationHistoryEntry immediately before activation (i.e., the entry we came from). This will be null if the navigation was cross-origin, or if the previous entry was not in the same-origin contiguous region of the back/forward list that is available in `navigation.entries()`. * `activation.navigationType`: The navigationType ('push', 'replace', 'reload', or 'traverse') of the navigation that activated the current Document. Note that `entry` or `from` may be a NavigationHistoryEntry that is no longer present in `navigation.entries()` (e.g., when doing a replace navigation, `activation.from` will be the replaced entry). In that case, the entry will remain visible, but because it is a "disposed" entry, its index will be -1 and attempting to `navigation.traverseTo()` its key will be rejected. Initial discussion: whatwg/html#9760 Draft spec PR: whatwg/html#9856 I2p: https://groups.google.com/a/chromium.org/g/blink-dev/c/EfqxeH3Iwh4 Bug: 1492932 Change-Id: I2e090a8366906e4cb6778893ad9ffdca18d6ec37 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4990011 Reviewed-by: Domenic Denicola <domenic@chromium.org> Commit-Queue: Nate Chapin <japhet@chromium.org> Cr-Commit-Position: refs/heads/main@{#1220983} Co-authored-by: Nate Chapin <japhet@chromium.org> -- wpt-commits: c2ca6ebdc7f92fbaf7308c91dda05bcaf24ef455 wpt-pr: 42873
Automatic update from web-platform-tests NavigationActivation prototype (#42873) NavigationActivation is a new object (exposed as `navigation.activation`). It is updated when a new Document is "activated": initial Document creation, restore from bfcache, or (in a future CL) prerender activation. It has three pieces of state: * `activation.entry`: The current NavigationHistoryEntry at the time of activation. * `activation.from`: The current NavigationHistoryEntry immediately before activation (i.e., the entry we came from). This will be null if the navigation was cross-origin, or if the previous entry was not in the same-origin contiguous region of the back/forward list that is available in `navigation.entries()`. * `activation.navigationType`: The navigationType ('push', 'replace', 'reload', or 'traverse') of the navigation that activated the current Document. Note that `entry` or `from` may be a NavigationHistoryEntry that is no longer present in `navigation.entries()` (e.g., when doing a replace navigation, `activation.from` will be the replaced entry). In that case, the entry will remain visible, but because it is a "disposed" entry, its index will be -1 and attempting to `navigation.traverseTo()` its key will be rejected. Initial discussion: whatwg/html#9760 Draft spec PR: whatwg/html#9856 I2p: https://groups.google.com/a/chromium.org/g/blink-dev/c/EfqxeH3Iwh4 Bug: 1492932 Change-Id: I2e090a8366906e4cb6778893ad9ffdca18d6ec37 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4990011 Reviewed-by: Domenic Denicola <domenic@chromium.org> Commit-Queue: Nate Chapin <japhet@chromium.org> Cr-Commit-Position: refs/heads/main@{#1220983} Co-authored-by: Nate Chapin <japhet@chromium.org> -- wpt-commits: c2ca6ebdc7f92fbaf7308c91dda05bcaf24ef455 wpt-pr: 42873
Automatic update from web-platform-tests NavigationActivation prototype (#42873) NavigationActivation is a new object (exposed as `navigation.activation`). It is updated when a new Document is "activated": initial Document creation, restore from bfcache, or (in a future CL) prerender activation. It has three pieces of state: * `activation.entry`: The current NavigationHistoryEntry at the time of activation. * `activation.from`: The current NavigationHistoryEntry immediately before activation (i.e., the entry we came from). This will be null if the navigation was cross-origin, or if the previous entry was not in the same-origin contiguous region of the back/forward list that is available in `navigation.entries()`. * `activation.navigationType`: The navigationType ('push', 'replace', 'reload', or 'traverse') of the navigation that activated the current Document. Note that `entry` or `from` may be a NavigationHistoryEntry that is no longer present in `navigation.entries()` (e.g., when doing a replace navigation, `activation.from` will be the replaced entry). In that case, the entry will remain visible, but because it is a "disposed" entry, its index will be -1 and attempting to `navigation.traverseTo()` its key will be rejected. Initial discussion: whatwg/html#9760 Draft spec PR: whatwg/html#9856 I2p: https://groups.google.com/a/chromium.org/g/blink-dev/c/EfqxeH3Iwh4 Bug: 1492932 Change-Id: I2e090a8366906e4cb6778893ad9ffdca18d6ec37 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4990011 Reviewed-by: Domenic Denicola <domenic@chromium.org> Commit-Queue: Nate Chapin <japhet@chromium.org> Cr-Commit-Position: refs/heads/main@{#1220983} Co-authored-by: Nate Chapin <japhet@chromium.org> -- wpt-commits: c2ca6ebdc7f92fbaf7308c91dda05bcaf24ef455 wpt-pr: 42873
Automatic update from web-platform-tests NavigationActivation prototype (#42873) NavigationActivation is a new object (exposed as `navigation.activation`). It is updated when a new Document is "activated": initial Document creation, restore from bfcache, or (in a future CL) prerender activation. It has three pieces of state: * `activation.entry`: The current NavigationHistoryEntry at the time of activation. * `activation.from`: The current NavigationHistoryEntry immediately before activation (i.e., the entry we came from). This will be null if the navigation was cross-origin, or if the previous entry was not in the same-origin contiguous region of the back/forward list that is available in `navigation.entries()`. * `activation.navigationType`: The navigationType ('push', 'replace', 'reload', or 'traverse') of the navigation that activated the current Document. Note that `entry` or `from` may be a NavigationHistoryEntry that is no longer present in `navigation.entries()` (e.g., when doing a replace navigation, `activation.from` will be the replaced entry). In that case, the entry will remain visible, but because it is a "disposed" entry, its index will be -1 and attempting to `navigation.traverseTo()` its key will be rejected. Initial discussion: whatwg/html#9760 Draft spec PR: whatwg/html#9856 I2p: https://groups.google.com/a/chromium.org/g/blink-dev/c/EfqxeH3Iwh4 Bug: 1492932 Change-Id: I2e090a8366906e4cb6778893ad9ffdca18d6ec37 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4990011 Reviewed-by: Domenic Denicola <domenic@chromium.org> Commit-Queue: Nate Chapin <japhet@chromium.org> Cr-Commit-Position: refs/heads/main@{#1220983} Co-authored-by: Nate Chapin <japhet@chromium.org> -- wpt-commits: c2ca6ebdc7f92fbaf7308c91dda05bcaf24ef455 wpt-pr: 42873
Editorial: remove closing tags on the dir attribute table Helps with whatwg#9832. Editorial: remove closing tags on the dir attribute table Helps with whatwg#9832. Editorial: Remove old FinishDynamicImport reference Restore early return for history.go(0) This accidentally was lost in 0a97a81. Editorial: add enumerated attribute table for draggable Helps with whatwg#9832. Editorial: add enumerated attribute table for form/autocomplete Helps with whatwg#9832. Fix PromiseRejectionEvent's promise attribute As discovered in whatwg/streams#1298 (comment), Promise<T> is actually not an appropriate type for it. Navigation API: add navigation.activation Closes whatwg#9760. Editorial: remove closing tags on the dir attribute table Helps with whatwg#9832. Editorial: remove closing tags on the dir attribute table Helps with whatwg#9832. Editorial: remove closing tags on the dir attribute table Helps with whatwg#9832. Editorial: remove closing tags on the dir attribute table Helps with whatwg#9832. Editorial: remove closing tags on the dir attribute table Helps with whatwg#9832. Editorial: remove closing tags on the dir attribute table Helps with whatwg#9832. Editorial: remove closing tags on the dir attribute table Helps with whatwg#9832. Editorial: remove closing tags on the dir attribute table Helps with whatwg#9832.
Following up on this idea from @domenic.
In some cases, like in view transition, developers want to customize the page/style/what not based on the last/current navigation: which URL did it come from, was it a back navigation, etc. For example, show a welcome message but not if it's a back navigation, or run a different animation if coming from the home page.
To use with CSS view transitions, the developer would listen to the proposed
readytorender
event (#9315) or some such, and then customize or skip the transition based on that info.My current thought about this right now is that this should be about activation rather than navigation - navigations can be same-document, and in the case of prerender the interesting point in time for this is when the document is activated rather than when it's prerendered.
Strawman API:
An alternative would be to expose info about the most recent cross-document navigation rather than activation. The difference would only be meaningful for prerendering, where the previous URL at time of activation is more meaningful than the URL at time of prerendering.
The text was updated successfully, but these errors were encountered: