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

[css-view-transitions-2] Timing of opt-in/type check on the new Document #9595

Closed
khushalsagar opened this issue Nov 13, 2023 · 3 comments
Closed
Labels
css-view-transitions-2 View Transitions; New feature requests

Comments

@khushalsagar
Copy link
Member

The spec currently resolves the opt-in on the new Document before dispatching the reveal event : https://drafts.csswg.org/css-view-transitions-2/#document-reveal.

This means authors can't use timing of the reveal event to customize the transition. For example, choosing between an element or fallback transition based on how much of the Document is parsed when the browser decides to paint. This was not an issue when the opt-in was limited to enabling/disabling the transition. The author could use viewTransition.abort() if the fallback was to disable the transition. But since the opt-in now also includes type, which is only read once on the new Document, authors won't be able to set the type to a fallback.

We should move when the opt-in is parsed to after dispatching the reveal event.

@noamr @bokand

@noamr
Copy link
Collaborator

noamr commented Nov 15, 2023

This would mean that the reveal event would have a viewTransition object even if the document didn't opt-in, and would automatically skip the transition when it's read I find that a bit counter-intuitive.

Since you can already skip the transition in the reveal event, perhaps #9542 would be a more direct way to customize VT types on the go rather than modify opt-in rules in CSSOM?

@khushalsagar
Copy link
Member Author

Since you can already skip the transition in the reveal event, perhaps #9542 would be a more direct way to customize VT types on the go rather than modify opt-in rules in CSSOM?

+1. I came around to this myself. See comment here: #9526 (comment)

@khushalsagar
Copy link
Member Author

Seems like there is agreement on not changing this timing. The approach suggested in the first comment will require changing stylesheets via CSSOM anyway (which is awkward). So exploring something like #9542 is a better way to address this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
css-view-transitions-2 View Transitions; New feature requests
Projects
None yet
Development

No branches or pull requests

2 participants