- From: Jake Archibald via GitHub <sysbot+gh@w3.org>
- Date: Mon, 04 Nov 2024 09:53:30 +0000
- To: public-css-archive@w3.org
Summary of my position: ## Minimising the difference between MPA and SPA A goal of the view transition API design should be that, if all else is equal, you get the same transition between two same-document states as different-document states. The reason for this goal is simply to make the API easy to understand as there are few behavioural 'forks' to lean, and avoids cases where it seems to break unexpectedly in ways that are hard to debug. This applies as much to simple usage as complex usage. If this isn't the goal, we should consider forking the whole API (eg `cross-document-transition-name`), so it's clear that there isn't an intent for these behaviours to be similar. I don't think this is necessary, as I think the goal is reasonable, and should be upheld. ## The issue with the `auto` proposal `match-element` breaks the above goal, because there's no equivalent between documents. Because of this, it should be kept as an exception. Developers should ideally know they're using part of the API that's only designed for SPA. `auto` is an inviting "we'll do it all for you" keyword that hides complexity. That isn't unusual in CSS, and often it's a good thing. But in this case it's taking in that inconsistent `match-element` behaviour, hiding it behind an inviting keyword, and mixing in some of the `attr(id ident)` behaviour so breakages are even less consistent and harder to debug. ## Proposal for `match-element` To avoid confusion between MPA and SPA, if `match-element` is calculated for an MPA transition, it should behave like `none` (or even fail the transition completely) and show a console warning. This will make it clear to developers that they're using a feature that doesn't work for these kinds of transitions. ## Proposal for `auto` Either drop the proposal, or: For elements, `auto` uses the element's `id` attribute value as the transition name. For pseudo-elements, `auto` uses a combination of the element's `id` and the pseudo-element name as the transition name. If the element doesn't have an `id` attribute (or it's invalid, or the empty string), the transition should fail. This does more than `attr(id ident)`, but still works equally between MPA and SPA. -- GitHub Notification of comment by jakearchibald Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/10995#issuecomment-2454252345 using your GitHub account -- Sent via github-notify-ml as configured in https://github.com/w3c/github-notify-ml-config
Received on Monday, 4 November 2024 09:53:31 UTC