Skip to content
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

[css-view-transitions-2] UAs should show loading indicators when waiting for response #9156

Open
khushalsagar opened this issue Aug 3, 2023 · 4 comments
Labels
css-view-transitions-2 View Transitions; New feature requests editorial

Comments

@khushalsagar
Copy link
Member

khushalsagar commented Aug 3, 2023

This came up on the TAG review. The transition flow for cross-document navigations leaves the current Document in-place until there is a response from the server for the new Document. The user can keep interacting with the old Document until this time.

We should add a non-normative note that the UA should start their loading indicators (most likely do so already) while we're waiting for a server response on the navigation (which will trigger the capture for transition).

@khushalsagar khushalsagar added editorial css-view-transitions-2 View Transitions; New feature requests labels Aug 3, 2023
@vmpstr
Copy link
Member

vmpstr commented Aug 4, 2023

Should this be a normative SHOULD note instead?

@Que-tin
Copy link

Que-tin commented Aug 24, 2023

Should there maybe be a pseudo-class to indicate that the new document is loading to enable pre-view-transition animations or custom loaders? But there would need to be UA styles to make sure a loading indicator is shown in case no custom logic is implemented.

@khushalsagar
Copy link
Member Author

Should there maybe be a pseudo-class to indicate that the new document is loading to enable pre-view-transition animations or custom loaders?

@noamr @domenic FYI. If there was such a class (or media-query like primitive), when would you expect it to stop applying so the loading indicator goes away. When the document does its first render, the load event fires, something else. Intuitively, load event makes sense. I think loading indicators in browser UI also stop when this event is fired.

But there would need to be UA styles to make sure a loading indicator is shown in case no custom logic is implemented.

Loading indicators by the browser are generally outside Document scope, so they're drawn irrespective of the page content. For example the loading bar or spinner in browser UI.

@domenic
Copy link
Collaborator

domenic commented Aug 24, 2023

If there was such a class (or media-query like primitive), when would you expect it to stop applying so the loading indicator goes away. When the document does its first render, the load event fires, something else. Intuitively, load event makes sense. I think loading indicators in browser UI also stop when this event is fired.

I tend to agree. Although another approach, which might be better, is to tie the pseudo-class explicitly to the browser loading indicator. The difference is that in cases where we give control over the loading indicator, such as with the existing navigation API for same-document navigations, or with new APIs such as whatwg/html#9090 / WICG/navigation-api#256 (comment) for cross-document navigations, the pseudo-class would follow the modified timing, instead of following the load event.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
css-view-transitions-2 View Transitions; New feature requests editorial
Projects
None yet
Development

No branches or pull requests

4 participants