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] Cross-document View Transition when there is a UA transition #8953

Closed
khushalsagar opened this issue Jun 13, 2023 · 1 comment · Fixed by #9528
Closed
Labels
css-view-transitions-2 View Transitions; New feature requests Needs Edits

Comments

@khushalsagar
Copy link
Member

This is related to #8888 but deserves its own discussion/resolution. Also related reading is #8747.

A navigation can involve a visual transition from both the UA and the author but we only want one to occur. Ideally author transitions should take precedence but there are cases where that's not possible because the requisite primitives are missing. The swipe scenario described here is one such case where some browsers (Chrome/Safari on iOS) already do a visual transition. It would be incorrect to do a ViewTransition following the browser transition.

So the UA needs to decide whether to execute the site's custom ViewTransition or override it with a UA transition, which is a tradeoff. For example:

  • Chrome/Safari on iOS do a visual transition with the page content during the swipe. The site doing a ViewTransition after this won't make sense.
  • Chrome/Firefox on Android don't do any visual transition during the swipe. The site could do a ViewTransition here when the swipe ends (similar to pressing the back button).

While browsers should err on the side of prioritizing the author's ViewTransition over the UA transition, it can be quite limiting for browser UX. This seems like something that could be left to the UA with a recommendation as long as only one transition is executed (avoiding correctness issues). For example, the browser will know whether the site wants to do a ViewTransition when the user starts swiping. It can choose to suppress the UA transition in favour of running the ViewTransition or choose to skip the ViewTransition (as if the author didn't opt-in to ViewTransitions) in favour of running the UA transition.

@khushalsagar khushalsagar added css-view-transitions-2 View Transitions; New feature requests Agenda+ labels Jun 13, 2023
@css-meeting-bot
Copy link
Member

The CSS Working Group just discussed [css-view-transitions-2] Cross-document View Transition when there is a UA transition, and agreed to the following:

  • RESOLVED: UAs may discard author transitions if they are providing their own
The full IRC log of that discussion <fantasai> khush: This was about, some browsers have transition as part of browser UX while navigating
<fantasai> khush: e.g. in Safari and Chrome today, if you swipe between pages you get default transition from UA
<fantasai> khush: Proposal is that if the UA does its own transition, don't do the author transition
<hober> q+
<fantasai> khush: if there's a use case where authors want to customize, could allow that somehow
<fantasai> khush: but don't run both
<fantasai> hober: I think that sounds good.
<fantasai> hober: I think the main case you identified on mobile is history swiping
<fantasai> hober: it would be bad if having two animations, so if spec allows browsers to skip transition in those cases seems fine
<fantasai> hober: there was a related issue wrt disabling browser animation, and I have concerns about that
<fantasai> astearns: Should we be more permissive and say that the UA can either skip the transition if providing their own, or somehow accommodate
<fantasai> hober: that would work for me too
<fantasai> astearns: other opinions?
<fantasai> astearns: proposed resolution is that UAs may discard author view transitions if they are providing their own
<fantasai> astearns: objections?
<fantasai> RESOLVED: UAs may discard author transitions if they are providing their own

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 Needs Edits
Projects
No open projects
Development

Successfully merging a pull request may close this issue.

2 participants