web-platform-tests / interop

web-platform-tests Interop project
https://wpt.fyi/interop
281 stars 28 forks source link

Detect UA Transitions on same-document Navigations #518

Closed khushalsagar closed 7 months ago

khushalsagar commented 11 months ago

Description

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.

Specification

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

Open Issues

No response

Tests

[Formerly:] https://github.com/web-platform-tests/wpt/pull/41326 and https://github.com/web-platform-tests/wpt/pull/41623.

https://wpt.fyi/results/?label=master&label=experimental&aligned&q=path%3A%2Fnavigation-api%2Fnavigate-event%2Fnavigate-navigation-back-same-document.html%20or%20path%3A%2Fnavigation-api%2Fnavigate-event%2Fevent-constructor.html%20or%20path%3A%2Fhtml%2Fbrowsers%2Fbrowsing-the-web%2Fhistory-traversal%2FPopStateEvent.html%20or%20path%3A%2Fhtml%2Fbrowsers%2Fbrowsing-the-web%2Fhistory-traversal%2Fpopstate_event.html

Note: The WPTs only test that the attribute is defined. When a UA transition is executed is left to the UA, so by design tests can't validate when the value should be set to true.

Current Implementations

Standards Positions

Webkit: https://github.com/WebKit/standards-positions/issues/176 Mozilla: https://github.com/mozilla/standards-positions/issues/783 Blink Intent to Ship: https://groups.google.com/a/chromium.org/g/blink-dev/c/OTGqhEZ7aug/m/tDfjCG4KAQAJ

Browser bug reports

No response

Developer discussions

This issue has come up for Webkit based browsers, example, since Webkit is the only engine shipping browser transitions for these navigations today.

Polls & Surveys

No response

Existing Usage

No response

Workarounds

Authors could try to polyfill it by listening to touchStart events, some details here. But there's no easy way to know whether the browser will turn a touch action stream into a navigation gesture which makes this approach brittle.

Accessibility Impact

No response

Privacy Impact

No response

Other

No response

gsnedders commented 10 months ago

Tests

[Formerly:] web-platform-tests/wpt#41326 and web-platform-tests/wpt#41623.

https://wpt.fyi/results/?label=master&label=experimental&aligned&q=path%3A%2Fnavigation-api%2Fnavigate-event%2Fnavigate-navigation-back-same-document.html%20or%20path%3A%2Fnavigation-api%2Fnavigate-event%2Fevent-constructor.html%20or%20path%3A%2Fhtml%2Fbrowsers%2Fbrowsing-the-web%2Fhistory-traversal%2FPopStateEvent.html%20or%20path%3A%2Fhtml%2Fbrowsers%2Fbrowsing-the-web%2Fhistory-traversal%2Fpopstate_event.html

Note: The WPTs only test that the attribute is defined. When a UA transition is executed is left to the UA, so by design tests can't validate when the value should be set to true.

We might want to exclude the tests that rely on navigation-api (a proposal in its own right, #435).

nairnandu commented 7 months ago

Thank you for proposing Detect UA Transitions on same-document Navigations for inclusion in Interop 2024.

We wanted to let you know that this proposal was not selected to be part of Interop 2024. This is because we got many more proposals than we could include in this year's project. Note that individual vendors may nevertheless choose to advance work in this area during the forthcoming year. We would welcome this proposal being resubmitted again next year, if necessary.

For an overview of our process, see proposal selection. Thank you again for contributing to Interop 2024!

Posted on behalf of the Interop team.