The `pageswap` event is fired on a Document's window object when a navigation will replace this Document with a new Document. The event provides activation info about the navigation (type, NavigationHistoryEntry for the new Document). If the navigation has a cross-document ViewTransition, the event is dispatched before capturing state for the old Document. This allows the page-author to configure the old state captured for the transition based on the navigation's activation info and the current visual state of the old Document. This feature is split out from the larger ViewTransition-on-Navigation project.
None
Does this intent deprecate or change behavior of existing APIs, such that it has potentially high risk for Android WebView-based applications?
None
None
https://wpt.fyi/results/html/browsers/browsing-the-web/history-traversal/pageconceal?label=experimental&label=master&aligned. A PR to rename the event to pageswap in WPTs is in flight.
Shipping on desktop | 124 |
Shipping on Android | 124 |
Shipping on WebView | 124 |
Open questions about a feature may be a source of future web compat or interop issues. Please list open issues (e.g. links to known github issues in the project for the feature specification) whose resolution may introduce web compat/interop risk (e.g., changing to naming or structure of the API in a non-backward-compatible way).
None--
You received this message because you are subscribed to the Google Groups "blink-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to blink-dev+...@chromium.org.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/blink-dev/CAMLuWUx41iLjW2A7LuvQfv95EOrVGh_969kit4WjuGZiu0ZhbQ%40mail.gmail.com.
On Thu, Feb 29, 2024 at 3:11 PM 'Khushal Sagar' via blink-dev <blin...@chromium.org> wrote:Specification
https://html.spec.whatwg.org/#the-pageswapevent-interfaceSummary
The `pageswap` event is fired on a Document's window object when a navigation will replace this Document with a new Document. The event provides activation info about the navigation (type, NavigationHistoryEntry for the new Document). If the navigation has a cross-document ViewTransition, the event is dispatched before capturing state for the old Document. This allows the page-author to configure the old state captured for the transition based on the navigation's activation info and the current visual state of the old Document. This feature is split out from the larger ViewTransition-on-Navigation project.
Blink component
Blink>ViewTransitionsTAG review
https://github.com/w3ctag/design-reviews/issues/851#issuecomment-1924730258TAG review status
PendingRisks
Interoperability and Compatibility
None
Gecko: Positive (https://github.com/mozilla/standards-positions/issues/969)
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/blink-dev/CAOMQ%2Bw-xt4YmqgZqo3s%2BsGwxebjQMeLr5Un3z2PWPwSAW4zRMA%40mail.gmail.com.
Summary
The `pageswap` event is fired on a Document's window object when a navigation will replace this Document with a new Document. The event provides activation info about the navigation (type, NavigationHistoryEntry for the new Document). If the navigation has a cross-document ViewTransition, the event is dispatched before capturing state for the old Document. This allows the page-author to configure the old state captured for the transition based on the navigation's activation info and the current visual state of the old Document. This feature is split out from the larger ViewTransition-on-Navigation project.
Why is it split out? Is there some utility for this regardless of view transitions?
Blink component
Blink>ViewTransitionsTAG review
https://github.com/w3ctag/design-reviews/issues/851#issuecomment-1924730258TAG review status
PendingRisks
Interoperability and Compatibility
None
Gecko: Positive (https://github.com/mozilla/standards-positions/issues/969)Is that the right position?
Summary
The `pageswap` event is fired on a Document's window object when a navigation will replace this Document with a new Document. The event provides activation info about the navigation (type, NavigationHistoryEntry for the new Document). If the navigation has a cross-document ViewTransition, the event is dispatched before capturing state for the old Document. This allows the page-author to configure the old state captured for the transition based on the navigation's activation info and the current visual state of the old Document. This feature is split out from the larger ViewTransition-on-Navigation project.
Why is it split out? Is there some utility for this regardless of view transitions?Absolutely! For example it's a place where you can figure out that you're navigating away to a different same-origin document (after redirects), and act on it in some way, e.g. put something in `sessionStorage` like a video playback position.
It's different from `pagehide` in that sense, because with `pagehide` you don't know you're going to a new document.
Also by having a generic event with an optional viewTransition property, it can tell the author that a view transition *didn't* take place, which we can't do with a view-transition event.The design for this (as for `pagerveal`) started from view-transition-specific events and ended up gravitating towards this kind of event with an optional attribute for this reason, and also to avoid a situation where people create fake view transitions for the purpose of getting these events.
Blink component
Blink>ViewTransitionsTAG review
https://github.com/w3ctag/design-reviews/issues/851#issuecomment-1924730258TAG review status
PendingRisks
Interoperability and Compatibility
None
Gecko: Positive (https://github.com/mozilla/standards-positions/issues/969)Is that the right position?Yes, the name was changed while iterating, but it's the same feature and Gecko folks took active part in the design and reviews.
What's going on with the tests?
https://wpt.fyi/results/html/browsers/browsing-the-web/history-traversal/pageswap?label=master&label=experimental&product=chrome&product=firefox&product=safari
LGTM2
/Daniel
To unsubscribe from this group and stop receiving emails from it, send an email to blink-dev+...@chromium.org.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/blink-dev/CAMLuWUzQKfk7EzQ%3DLA6R2Stq0pj-VgrhZpgfAyaAJA1P16BJJA%40mail.gmail.com.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/blink-dev/311f40bb-435c-41f7-a04b-1f98e980366d%40gmail.com.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/blink-dev/CAMLuWUw%2BOiOR8mUimvGf96RX9pnhgbwRRMpDsCrnsBdwq6n3Hg%40mail.gmail.com.