Smooth visual transitions as users navigate on the web can lower cognitive load by helping users stay in context. It can also provide a visual cue about the destination before initiating the navigation. Both site authors and user-agents (UAs) add visual transitions to their navigations for these use-cases. 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. The goal of this proposal is to avoid such cases to ensure only one visual transition is executed at a time.
The main interop risk with this proposal is whether UA transitions should be allowed by default or not. Allowing them by default has a compat risk of breaking sites which ship with custom transitions already. We could try to assess the impact with heuristics like "detect whether the Document is constantly animating for x seconds after firing popstate/navigate event" but it's likely to have false positives. Also note that Safari/Chrome on iOS already ship with UA transitions by default.
If an author chooses to disable UA transitions for a subset of navigations, they will need to use the API proposed here to detect whether a UA transition was executed for a navigation.
The API lets the site author selectively disable UA transitions based on whether the navigation was predictive (swipe) vs atomic (button click). The author can then detect whether a transition occurred using the API proposed in https://chromestatus.com/feature/5204831477694464. This effectively means site authors can detect whether the navigation was swipe or atomic; and in turn whether the device supports a category of navigations. However, this information can already be derived using the UA string.
Does this intent deprecate or change behavior of existing APIs, such that it has potentially high risk for Android WebView-based applications?
None
No milestones specified