Intent to Ship: Detect UA Transitions on same-document Navigations

138 views
Skip to first unread message

Khushal Sagar

unread,
Aug 14, 2023, 10:50:42 AM8/14/23
to blink-dev

Contact emails

khusha...@google.comliuwi...@google.comhvano...@google.com

Explainer

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

Specification

https://github.com/whatwg/html/pull/9579

Summary

Smooth visual transitions as users navigate on the web can lower cognitive load by helping users stay in context. However, the user experience is bad if both the site author and the UA add these transitions: the transitions may conflict and cause confusion for the user. This API avoids such cases to ensure only one visual transition is executed at a time. The API adds a boolean on `PopStateEvent` and `NavigateEvent` to indicate whether the UA has executed a visual transition for this navigation. Authors can use this to skip their custom transition.



Blink component

Blink>DefaultNavigationTransitions

TAG review

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

TAG review status

Issues addressed

Risks



Interoperability and Compatibility

This feature is a progressive enhancement. In the absence of the feature, the author has to either conservatively assume there is a UA transition (and not do a custom transition) or risk visual glitches from double transition. As such there is no interop risk.



Gecko: No signal (https://github.com/mozilla/standards-positions/issues/783)

WebKit: Positive (https://github.com/WebKit/standards-positions/issues/176)

Web developers: Strongly positive Issues like this: https://stackoverflow.com/questions/66867737/iphone-safari-detect-swipe-navigation. This is likely to happen more as authors can now use ViewTransitions to add custom transitions in SPAs.

Other signals:

Activation

None



Security

None. The API is limited to same-document navigations.



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



Debuggability



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?

No. WPTs assert that the attribute is present but not the value. By design, when this is set is left to the UA.

Flag name on chrome://flags



Finch feature name

None

Non-finch justification

None

Requires code in //chrome?

False

Estimated milestones

Shipping on desktop118
Shipping on Android118
Shipping on WebView118


Anticipated spec changes

None



Link to entry on the Chrome Platform Status

https://chromestatus.com/feature/5204831477694464

Links to previous Intent discussions

Intent to prototype: https://groups.google.com/a/chromium.org/g/blink-dev/c/UJMYZXoSQ4A/m/OkIvKVtlAAAJ

This intent message was generated by Chrome Platform Status.

Chris Harrelson

unread,
Aug 16, 2023, 1:39:12 PM8/16/23
to Khushal Sagar, blink-dev
LGTM1 to ship once the spec PR has landed.

--
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/CAMLuWUyhcTn1%3D%3DxfV0i5tyLS-APwqfDpetBstDie_4uMyxB1xQ%40mail.gmail.com.

Mike Taylor

unread,
Aug 16, 2023, 1:44:39 PM8/16/23
to Chris Harrelson, Khushal Sagar, blink-dev

Khushal Sagar

unread,
Aug 17, 2023, 1:32:49 PM8/17/23
to Mike Taylor, Chris Harrelson, blink-dev
FYI, the spec PR has landed.

Khushal Sagar

unread,
Aug 22, 2023, 10:16:52 AM8/22/23
to Mike Taylor, Chris Harrelson, blink-dev
Clarifying since the explainer mentions 2 APIs. This intent is limited to a boolean so sites can detect whether there is a UA transition and suppress their custom transition.

We've paused work on an API to let authors disable UA transitions. Community feedback (see TAG review here) was against developers disabling useful browser UX. Long term thinking is to introduce APIs that let authors customize navigation gestures (whenever possible) which are favoured over UA transitions. For cases where that's not possible (either because APIs to customize don't exist today or the UX makes developer customization infeasible), this API ensures there are no "double transitions".

Chrome plans to ship UA transitions for swipe gestures soon where this boolean will be set. The behaviour aligns with Webkit based browsers.

Yoav Weiss

unread,
Aug 22, 2023, 10:21:54 AM8/22/23
to Khushal Sagar, Mike Taylor, Chris Harrelson, blink-dev
Reply all
Reply to author
Forward
0 new messages