diff --git a/cross-doc-explainer.md b/cross-doc-explainer.md index 5531b02..24abc77 100644 --- a/cross-doc-explainer.md +++ b/cross-doc-explainer.md @@ -83,9 +83,8 @@ though to make this fully expressive, e.g. opt in conditionally based on reduced versions, or URL patterns, this would need a more elaborate definition, e.g.: ```css -@cross-document-view-transitions: allow; -@prefers-reduced-motion { - @cross-document-view-transitions: skip; +@auto-view-transitions { + same-origin: enabled; } ``` @@ -143,15 +142,13 @@ observed](https://drafts.csswg.org/css-view-transitions-1/#dom-viewtransition-fi To accomplish the same control and observability, the developer would need access to a [ViewTransition](https://drafts.csswg.org/css-view-transitions-1/#the-domtransition-interface) -object. There are several ways to approach this, and this is an open issue. For example: - -1. Expose it via `document.pendingViewTransition`. This would be available only before the document -gets render-unblocked for the first time, and right at reactivation. - -1. Fire a special `reveal` event at both lifecycle moments, with a `ViewTransition` object. See [whatwg/html#9315](https://github.com/whatwg/html/issues/9315), w3c/csswg-drafts#8682, and w3c/csswg-drafts#8805. +object. To achieve that, we propose to fire a `reveal` event at both lifecycle moments, with a `ViewTransition` object. +See [whatwg/html#9315](https://github.com/whatwg/html/issues/9315), w3c/csswg-drafts#8682, and w3c/csswg-drafts#8805. Note that this event is different from [`pageshow`](https://html.spec.whatwg.org/#event-pageshow) as in the newly initialized document `pageshow` is only fired once the document is fully loaded. +A potential alternative would be to expose it via `document.activeViewTransition` or `document.pendingViewTransition`. This would be available only before the document gets render-unblocked for the first time or at reactivation. Currently not proposing this, as developers would have to remember to query for this both at initialization and reactivation, which could become a footgun. + Note: skipping a transition on `pagehide` is guaranteed to happen before the new document is activated. # Further discussions