Skip to content
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

Update cross-doc-explainer.md #211

Merged
merged 2 commits into from
Jul 11, 2023
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 7 additions & 9 deletions cross-doc-explainer.md
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
```

Expand Down Expand Up @@ -143,15 +142,14 @@ 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`. This would be available only before the document
gets render-unblocked for the first time.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This would be available only before the document gets render-unblocked for the first time.

Are you trying to say that the accessor returns null once the Document is no longer render-blocked on initial load? It's obvious this misses the activation cases but they're technically doable. Would be better to have some text clarifying why we're not proposing this syntax. Something like: "figuring out when this should be queried for activation cases, in the absence of an event, is hard"?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Right, clarified


Note: skipping a transition on `pagehide` is guaranteed to happen before the new document is activated.

# Further discussions
Expand Down