-
Notifications
You must be signed in to change notification settings - Fork 58
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
Shared Element Transitions - Early Review #631
Comments
Hi @ianvollick. Thanks for raising this to us. We're just discussing in today's call and one question that I had is: can you clarify the issue you've raised in the security & privacy answers regarding sites opting in to this behaviour (possibly with a specific example)? |
Hi there @ianvollick!
Could you please clarify? |
Thank you for taking a look! Responses inline.
In this case, I'd flagged this since I thought this would be of interest to the landing site rather than the user. In that sense, this may not be a Security & Privacy issue (though this could be impacted by the eventual design of the multi-page API [1]). I can certainly give some more detail, though. Say we have a page that wants to link to another site (perhaps a recipe) and would like to animate a hero image into place on the second page. On page A, the image might be a picture of a pie, and on page B, this might be a picture of the ingredients on the table and the transition would slide the image into place. Now, say site B would prefer not to have such a transition to their page. We had suggested in the questionnaire that site B could state a preference that this not happen, but an opt-in is also something that we're considering and may be the right approach in some cases. [1] For example, if we go with a declarative API, we don't expect this to be observable by script, and if the Security & Privacy Questionnaire responses change as multi-page API is developed, we will request a re-review.
Here's a list of a few possible use cases
It isn't possible to achieve these effects in a multi-page application (MPA) since elements cannot persist across a transition between pages. Some folks end up creating SPAs just to create these kinds of effects, and wouldn't have to once we have an MPA-friendly API. In the SPA case, it is certainly possible to create many of these effects today, though it is cumbersome. In our research, it has proven so cumbersome that sites often simply don’t do it (two very large, well-funded, non-Google web properties told us as much). The complication with SPAs is that we need to have live DOM available for both states at the same time, and it's common to get the details wrong (eg, old state might remain clickable, the outgoing state may stick around after the transition), leading to difficult-to-debug issues and can have a negative impact on accessibility. We feel that an API such as this would make authoring this sort of transition extremely easy, and offer better performance and user agent control (e.g. to skip animations when the user doesn't want it). The question of whether we could layer atop existing APIs is a good one and related to some developer feedback we've already received [2]. We certainly aim to permit customization of these effects (we're currently preparing for an origin trial to learn more about what customizations are most needed), but the initial API shape was chosen to provide a convenient way to "snapshot" page state at a given point of time and provide UA-defaults for common transitions. That said, I think this API could definitely be made more idiomatic and reuse concepts (eg, using easing functions to specify curves, or something like the suggestion in [2]). I expect that this will evolve a lot in the specification process – this is a very early review; the multi-page API hasn't even been sketched (and for this, one approach we're considering is entirely CSS-based). |
I can think of two other sources you should look at.
|
and Windows, for completeness. |
Thanks hober and cynthia! Those are definitely good areas to look at for inspiration in researching this space more. |
Hi @ianvollick! We looked at this again during a breakout in our Gethen (V)F2F today. In terms of the proposal that is outlined in this explainer, we feel that an API for Shared Element Transitions (SETs) should provide the kinds of primitives that designers can use to define transitions, not only expose a small predefined set of “canned” effects, which tends to not scale well over time as design trends and collective aesthetics evolve. But more importantly, while SETs in SPAs are useful, we still feel that MPAs are by far the primary use case and the SET API needs to be designed with both in mind. We don’t want to end up with two separate SET APIs, one for SPAs and one for MPAs. The current proposal only works for SPAs with no obvious way to extend it to MPAs. SETs for MPAs appear to be in the early brainstorming phase, so there is not much for us to comment on, besides that we certainly recognize that there is a strong user need. Therefore we are going to close this and look forward to reviewing it again in the future when there is a concrete API proposal to review. |
Hi TAG, We’ve taken your feedback and updated our proposal. The new explainer describes an API that is built on existing animation primitives. Specifically, the API creates new pseudo-elements that are targetable by CSS and a set of default CSS animations. Developers can target these pseudo elements using existing CSS concepts and animation APIs (CSS transitions, animations and Web Animations) to customize their transitions. This explainer also delves deeper into how this API will work in a same-origin different-document navigation. We believe that the updated API can serve both the SPA and MPA use-cases. We would appreciate it if you could take another look at this proposal. We look forward to your comments and thanks in advance! (Would you be able to reopen this issue while the discussion continues?) |
Note that a draft of the spec for SPA portion available here https://tabatkins.github.io/specs/css-shared-element-transitions/. This doesn't include MPA transitions, but those should be described in some detail in the explainer. |
The review for the updated API is being discussed here. |
Ya ya yawm TAG!
I'm requesting a TAG review of the Shared/Root Element Transitions API.
Summary
Shared Element Transitions is a proposal for a new script API that allows a simple set of transitions in both Single-Page Applications (SPAs) and Multi-Page Applications (MPAs).
The inspiration for this feature are transitions similar to the ones listed in the Material Design Principles.
The intent is to support transitions similar to Android Activity Transitions.
In the SPA case, this entails capturing pre-transition visuals, updating the page, and animating to the post-transition state. The API for MPAs is still being designed (issue here).
Further details:
We'd prefer the TAG provide feedback as (please delete all but the desired option):
☂️ open a single issue in our GitHub repo for the entire review
The text was updated successfully, but these errors were encountered: