Intent to Ship: View Transitions: single-page apps

808 views
Skip to first unread message

Khushal Sagar

unread,
Jan 19, 2023, 3:12:32 PM1/19/23
to blink-dev

Contact emails

bo...@chromium.org, hvano...@chromium.org,  jakear...@chromium.org, khusha...@chromium.org, vmp...@chromium.org

Explainer

https://github.com/WICG/view-transitions/blob/main/explainer.md


Specification

https://www.w3.org/TR/css-view-transitions-1


Summary

View Transitions is an API that enables the creation of polished transitions. Web developers only need minimal effort to make transitions look nice. They can choose to use some default animation properties, or they can customize their own transition effects to achieve a desired transition experience.


This is accomplished by leveraging user-agents’ ability to persist visual representations of rendered output (i.e. snapshots) and blend them with the live DOM state’s rendered output. The API also allows these animations to be customized via standard CSS animation properties.


Note that while this intent is limited to shipping an API for same-document transitions (i.e. by using document.startViewTransition, as outlined in the spec), there is ongoing work to provide this feature for same-origin, cross-document navigations (MPA). MPA support will be added as a follow up via a separate intent to ship.


Blink component

Blink>ViewTransitions


TAG review

https://github.com/w3ctag/design-reviews/issues/748


TAG review status

Pending


Risks


Interoperability and Compatibility

Low. As a new feature, the primary risk is that other browsers do not implement it. But since this is a progressive enhancement, sites should be able to feature-detect and drop usage of the feature easily in browsers where it is not supported without breaking any site functionality.


This feature can be feature-detected by checking the existence of the document.startViewTransition function:

```js

if (!document.startViewTransition) {

  /* feature is not available */

} else {

  /* start transition */

}

```

Gecko: Under consideration (https://github.com/mozilla/standards-positions/issues/677)


WebKit: No signal (https://github.com/WebKit/standards-positions/issues/48)


Web developers: Strongly positive interest in and developer experimentation with the API:


Ergonomics

None.


Activation

   Low.


As with interop/compat risks, the difficulty stems from this being a new feature without support in other browsers. A polyfill for the SPA case would be beneficial. That said, this feature is a progressive enhancement for sites; they can easily use the API and  still function correctly on browsers that do not support the feature.


Security

The primary security constraint is ensuring isolation of graphics resources from multiple origins. The design achieves that by using Chromium's Viz process, similar to site isolation for iframes.


See also the security and privacy self-review questionnaire that was completed as part of the TAG review process: https://github.com/WICG/view-transitions/blob/main/security-privacy-questionnaire.md


The following issues track review from security/privacy WGs: https://github.com/w3c/security-request/issues/43 and https://github.com/w3cping/privacy-request/issues/107.



WebView application risks

Does this intent deprecate or change behavior of existing APIs, such that it has potentially high risk for Android WebView-based applications?

None. This feature is fully available and functional for WebView.


Debuggability

The feature can be debugged using standard tooling in devtools. Specifically, the animations drawer tab can be used to pause and scrub through all animations on generated pseudo-elements.


The pseudo DOM structure generated by the user agent can also be inspected and targeted, like other DOM elements, in the style panel.


Will this feature be supported on all six Blink platforms (Windows, Mac, Linux, Chrome OS, Android, and Android WebView)?

Yes


Is this feature fully tested by web-platform-tests?

Yes


DevTrial instructions

https://developer.chrome.com/docs/web-platform/view-transitions


Flag name

ViewTransition


Requires code in //chrome?

False


Tracking bug

https://bugs.chromium.org/p/chromium/issues/detail?id=1405452


Measurement

Usage is tracked via a UseCounter: https://source.chromium.org/chromium/chromium/src/+/main:third_party/blink/renderer/core/view_transition/view_transition_supplement.idl;l=9;drc=501455e6942313c87a276e8fde93e507786cc51c


Sample links

https://developer.chrome.com/docs/web-platform/view-transitions


Previous milestones

OriginTrial desktop last

106

OriginTrial desktop first

104

DevTrial on desktop

104


OriginTrial Android last

106

OriginTrial Android first

104

DevTrial on Android

104



Anticipated spec changes

Open questions about a feature may be a source of future web compat or interop issues. Please list open issues (e.g. links to known github issues in the project for the feature specification) whose resolution may introduce web compat/interop risk (e.g., changing to naming or structure of the API in a non-backward-compatible way).

The following open issues are awaiting resolution in CSSWG: https://github.com/w3c/csswg-drafts/issues?q=is%3Aopen+css-view-transitions+label%3Acss-view-transitions-1+label%3AAgenda%2B. We anticipate that any change from a resolution on these issues has minimal to no compat risk.


Link to entry on the Chrome Platform Status

https://chromestatus.com/feature/5193009714954240


Links to previous Intent discussions

Intent to prototype: https://groups.google.com/a/chromium.org/g/blink-dev/c/7SMI3IklO4g/m/JS-JojxNAwAJ

Intent to Experiment: https://groups.google.com/a/chromium.org/d/msgid/blink-dev/CAMLuWUyUH0939fLa7xH_EuRtgn0MWBzG8qzLMmH0zJ9GBBTh-A%40mail.gmail.com



This intent message was generated by Chrome Platform Status.


Mike Taylor

unread,
Jan 23, 2023, 1:55:27 PM1/23/23
to Khushal Sagar, blink-dev
Hi Khushal,

On 1/19/23 3:12 PM, Khushal Sagar wrote:

Contact emails

bo...@chromium.org, hvano...@chromium.org,  jakear...@chromium.org, khusha...@chromium.org, vmp...@chromium.org

Explainer

https://github.com/WICG/view-transitions/blob/main/explainer.md


Specification

https://www.w3.org/TR/css-view-transitions-1


Summary

View Transitions is an API that enables the creation of polished transitions. Web developers only need minimal effort to make transitions look nice. They can choose to use some default animation properties, or they can customize their own transition effects to achieve a desired transition experience.


This is accomplished by leveraging user-agents’ ability to persist visual representations of rendered output (i.e. snapshots) and blend them with the live DOM state’s rendered output. The API also allows these animations to be customized via standard CSS animation properties.

Note that while this intent is limited to shipping an API for same-document transitions (i.e. by using document.startViewTransition, as outlined in the spec), there is ongoing work to provide this feature for same-origin, cross-document navigations (MPA). MPA support will be added as a follow up via a separate intent to ship.


Blink component

Blink>ViewTransitions


TAG review

https://github.com/w3ctag/design-reviews/issues/748

Can you confirm that all the follow-up issues filed in response to feedback in this review are backwards-compatible with what you propose to ship now?
--
You received this message because you are subscribed to the Google Groups "blink-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to blink-dev+...@chromium.org.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/blink-dev/CAMLuWUxa3FH0pseWhQWg3w0ESfHMhjK3KLyat8G4sQzZ0tmzOA%40mail.gmail.com.


Khushal Sagar

unread,
Jan 23, 2023, 2:26:28 PM1/23/23
to Mike Taylor, Khushal Sagar, blink-dev
On Mon, Jan 23, 2023 at 1:55 PM Mike Taylor <mike...@chromium.org> wrote:
Hi Khushal,

On 1/19/23 3:12 PM, Khushal Sagar wrote:

Contact emails

bo...@chromium.org, hvano...@chromium.org,  jakear...@chromium.org, khusha...@chromium.org, vmp...@chromium.org

Explainer

https://github.com/WICG/view-transitions/blob/main/explainer.md


Specification

https://www.w3.org/TR/css-view-transitions-1


Summary

View Transitions is an API that enables the creation of polished transitions. Web developers only need minimal effort to make transitions look nice. They can choose to use some default animation properties, or they can customize their own transition effects to achieve a desired transition experience.


This is accomplished by leveraging user-agents’ ability to persist visual representations of rendered output (i.e. snapshots) and blend them with the live DOM state’s rendered output. The API also allows these animations to be customized via standard CSS animation properties.

Note that while this intent is limited to shipping an API for same-document transitions (i.e. by using document.startViewTransition, as outlined in the spec), there is ongoing work to provide this feature for same-origin, cross-document navigations (MPA). MPA support will be added as a follow up via a separate intent to ship.


Blink component

Blink>ViewTransitions


TAG review

https://github.com/w3ctag/design-reviews/issues/748

Can you confirm that all the follow-up issues filed in response to feedback in this review are backwards-compatible with what you propose to ship now?

Yes, most follow-up issues filed based on TAG feedback are about transitions initiated from navigations. This is part of the MPA work which we plan to ship as a follow up and it can be shipped independently of the same-document transitions covered by this intent.

The only issue on that review which concerns same-document transitions is #8319, a syntax which would allow selecting a subset of generated pseudo-elements. This syntax addition can be made in a backwards-compatible way.

Mike Taylor

unread,
Jan 23, 2023, 4:19:28 PM1/23/23
to Khushal Sagar, blink-dev
LGTM1

On 1/23/23 2:26 PM, Khushal Sagar wrote:


On Mon, Jan 23, 2023 at 1:55 PM Mike Taylor <mike...@chromium.org> wrote:
Hi Khushal,

On 1/19/23 3:12 PM, Khushal Sagar wrote:

Contact emails

bo...@chromium.org, hvano...@chromium.org,  jakear...@chromium.org, khusha...@chromium.org, vmp...@chromium.org

Explainer

https://github.com/WICG/view-transitions/blob/main/explainer.md


Specification

https://www.w3.org/TR/css-view-transitions-1


Summary

View Transitions is an API that enables the creation of polished transitions. Web developers only need minimal effort to make transitions look nice. They can choose to use some default animation properties, or they can customize their own transition effects to achieve a desired transition experience.


This is accomplished by leveraging user-agents’ ability to persist visual representations of rendered output (i.e. snapshots) and blend them with the live DOM state’s rendered output. The API also allows these animations to be customized via standard CSS animation properties.

Note that while this intent is limited to shipping an API for same-document transitions (i.e. by using document.startViewTransition, as outlined in the spec), there is ongoing work to provide this feature for same-origin, cross-document navigations (MPA). MPA support will be added as a follow up via a separate intent to ship.


Blink component

Blink>ViewTransitions


TAG review

https://github.com/w3ctag/design-reviews/issues/748

Can you confirm that all the follow-up issues filed in response to feedback in this review are backwards-compatible with what you propose to ship now?

Yes, most follow-up issues filed based on TAG feedback are about transitions initiated from navigations. This is part of the MPA work which we plan to ship as a follow up and it can be shipped independently of the same-document transitions covered by this intent.

The only issue on that review which concerns same-document transitions is #8319, a syntax which would allow selecting a subset of generated pseudo-elements. This syntax addition can be made in a backwards-compatible way.

Thanks, SGTM.

Mike West

unread,
Jan 24, 2023, 5:06:12 AM1/24/23
to Mike Taylor, Khushal Sagar, blink-dev
LGTM2.

That said, I'd note Mozilla's desire in the standards position thread to couple this with the multi-page transition work. I agree with your position that the two can be decoupled, and I don't see anything that screams back-compat risk skimming through the followup issues that the TAG created. I likewise don't see anything that jumps out at me as locking us into any particular design for a declarative version of this mechanism as our friends in the TAG have pointed towards.

Shipping this as an iterative step sounds like it satisfies some developer interest, and give us valuable implementation experience that can inform further development. Good luck landing it!

-mike


Yoav Weiss

unread,
Jan 24, 2023, 5:11:54 AM1/24/23
to Mike West, Mike Taylor, Khushal Sagar, blink-dev
LGTM3

Super excited about this work and solving those critical use cases (for both SPA and MPA). Thanks for tackling this!!

Jake Archibald

unread,
Jan 24, 2023, 8:05:34 AM1/24/23
to blink-dev, Mike West, Khushal Sagar, blink-dev, Mike Taylor
An important part of this for us was to ensure that we didn't 'design ourselves in a corner'. A part of this, we sketched out many additional features we want to add to ensure the current design is future-compatible:
I'm confident we can ship this stuff step-by-step. A lot of developers are more excited about the cross-document stuff, me included, but I don't think we need to delay the same-document stuff.

To unsubscribe from this group and stop receiving emails from it, send an email to blink-dev+unsubscribe@chromium.org.

--
You received this message because you are subscribed to the Google Groups "blink-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to blink-dev+unsubscribe@chromium.org.
Reply all
Reply to author
Forward
0 new messages