Re: [csswg-drafts] [css-view-transitions-2] view-transition-name determined by element (#8320)

The CSS Working Group just discussed `[css-view-transitions-2] view-transition-name determined by element `.

<details><summary>The full IRC log of that discussion</summary>
&lt;emilio> vmpstr: unique names for transitions is cumbersome because authors need to come up with a bunch of unique names<br>
&lt;emilio> ... various proposals<br>
&lt;emilio> ... one is to have v-t-n: auto / from-element which matches with element identity<br>
&lt;emilio> ... so as long as it doesn't change it works nicely<br>
&lt;emilio> ... but it doesn't work with cross-document transitions<br>
&lt;emilio> ... and also for frameworks that might replace the dom nodes<br>
&lt;emilio> ... another proposal is `element-uuid()` but it's effectively the same as above, just more explicit<br>
&lt;emilio> ... another one is `attr()`, which would work for cross-document v-t and frameworks<br>
&lt;emilio> ... my proposal would be to do both<br>
&lt;khush> q?<br>
&lt;emilio> ... leaving attr for more advanced use cases<br>
&lt;emilio> q+<br>
&lt;astearns> ack fantasai<br>
&lt;emilio> fantasai: I think doing both (`auto` / `from-element` and `attr()`) makes sense<br>
&lt;emilio> ... there was another idea in the thread which needs more thought<br>
&lt;emilio> ... right now we restrict v-t-n to be unique<br>
&lt;emilio> ... if it's not it gets ignored or something, it's an error condition<br>
&lt;emilio> ... in a bunch of cases, let's say you're reordering a list or so you don't necessarily want to number them all<br>
&lt;emilio> ... if we could have multiple names and we could number them somehow automatically that might help<br>
&lt;emilio> ... but that might be doable in addition to these things<br>
&lt;astearns> ack emilio<br>
&lt;fantasai> s/reordering/shifting items after inserting into/<br>
&lt;flackr> emilio: my main concern is how likely is it for someone to use from element and not realize it doesn't work for cross document?<br>
&lt;flackr> emilio: from where i stand it seems obv it doesn't work, but requires some internals knowledge<br>
&lt;astearns> q+<br>
&lt;flackr> emilio: just a mild concern, not blocking.<br>
&lt;emilio> ack fantasai<br>
&lt;Zakim> fantasai, you wanted to answer emilio's question<br>
&lt;astearns> ack fantasai<br>
&lt;emilio> fantasai: vt has been focused on the fact that you have "pages", and you're changing pages from one page in a web app to another one<br>
&lt;emilio> ... but lots of transitions authors can do are single-page<br>
&lt;emilio> ... and sometimes view-transitions is the best tool<br>
&lt;emilio> ... for those cases this element identity stuff it's not an issue<br>
&lt;ydaniv> +1<br>
&lt;flackr> emilio: for those use cases this is fine, it just feels like it might be confused<br>
&lt;flackr> emilio: or worse the browser could accidentally have a same pointer<br>
&lt;flackr> emilio: i guess that's just a bug<br>
&lt;emilio> flackr: my comment is somewhat related<br>
&lt;astearns> ack flackr<br>
&lt;emilio> ... while I agree that attr() should be supported<br>
&lt;emilio> ... if the common case is an identity<br>
&lt;emilio> ... maybe we can roll it into `auto` in-some cases<br>
&lt;emilio> ... so if element has an `id` attribute then `auto` would take that<br>
&lt;fantasai> interesting<br>
&lt;emilio> ... or an ancestor one or something<br>
&lt;emilio> vmpstr: we still need to define for the `auto` cases<br>
&lt;emilio> ... we still need some identifier that an author can see<br>
&lt;emilio> ... I think the element's uuid is a good choice there<br>
&lt;fantasai> -1 to uuid<br>
&lt;emilio> ... but we haven't thought too much about it<br>
&lt;emilio> q+<br>
&lt;fantasai> if the author wants to reference it they should give it a name<br>
&lt;khush> q+<br>
&lt;fantasai> using the id attribute<br>
&lt;emilio> astearns: I think the automatic number is interesting but has a different set of failure modes that it probably could be a separate issue<br>
&lt;vmpstr> it's about the param in ::view-transition-group(param) etc, not sure what to put there, or leave it as "auto"?<br>
&lt;emilio> ... I wanted to push back a bit, it seems a bit of a smell that people don't want to put unique names in css so we make them put it on the markup?<br>
&lt;astearns> ack astearns<br>
&lt;astearns> ack fantasai<br>
&lt;Zakim> fantasai, you wanted to respond to astearns<br>
&lt;emilio> fantasai: a lot of times you have these unique ids already<br>
&lt;emilio> ... so you might as well just reuse them<br>
&lt;astearns> ack emilio<br>
&lt;fantasai> I like flackr's idea of having `auto` take the ID if it has one, and fall back to element identity matching otherwise<br>
&lt;flackr> emilio: just want to confirm, allowing attr would make this id mutable in some interesting ways. I guess we have a well defined point where we collect them so it doesn't add much complexity, right?<br>
&lt;astearns> q+<br>
&lt;flackr> khush: I imagine it's similar to attribute changes requiring recomputing style<br>
&lt;flackr> emilio: my point is, if the mutation happens after we start the transition, then presumably it shouldn't count? This detail probably needs to be mentioned<br>
&lt;flackr> khush: this is called out already for view-transition-name as it's an issue already for name changes<br>
&lt;flackr> emilio: sounds good<br>
&lt;flackr> emilio: the auto thing seems like it could use a bit more work since as vmpstr mentioned the name is exposed in the css. My slight preference is to resolve attr and figure out auto later<br>
&lt;flackr> emilio: happy to also resolve on auto and resolve the details later<br>
&lt;astearns> ack khush<br>
&lt;emilio> khush: +1 to fantasai, attr() is useful where you already have unique names for your items without having to use JS<br>
&lt;emilio> ... the other thing is, I think we'll have an easier time resolving on attr()<br>
&lt;flackr> +1 as well, css is often in a separate file and not unique per element<br>
&lt;emilio> ... for auto / from-element vs element-uuid<br>
&lt;emilio> ... there was an example where element-uuid could be used to name an ancestor or child of an element rather than auto<br>
&lt;emilio> ... auto would only allow to set the id on that element itself<br>
&lt;flackr> q+<br>
&lt;emilio> ... one other point was that anything that ties with element identity it doesn't work for MPA<br>
&lt;emilio> ... we might want to just ignore the name altogether for MPA transitions<br>
&lt;emilio> ... so it's harder to miss<br>
&lt;emilio> ... but I think we should probably resolve on attr() and work on the other details on transitions<br>
&lt;emilio> astearns: I wanted to ask whether it'd make sense to make from-element only work on SPA and reserve auto for something that can work eventually on MPA<br>
&lt;emilio> ... so resolve on from-element for now, and opening an issue on an additional auto which does something along the lines that flackr was suggesting<br>
&lt;emilio> vmpstr: I don't mind the idea but I'd like a different name that from-element<br>
&lt;emilio> ... I'd prefer a different id<br>
&lt;astearns> ack astearns<br>
&lt;astearns> ack flackr<br>
&lt;emilio> ... because from-element seems you're reading something from the element rather than using the element itself<br>
&lt;emilio> TabAtkins: can we take it back to the issue? random() has similar use cases and we should make sure they're in sync<br>
&lt;emilio> flackr: for auto / from-element it was mentioned that this is exposed<br>
&lt;emilio> ... is that necessary?<br>
&lt;emilio> ... are there other ways we could do it?<br>
&lt;emilio> vmpstr: we can hide it by using auto<br>
&lt;emilio> ... we don't currently have the same parameter in the view transition pseudos I don't think it's a problem<br>
&lt;emilio> ... the reason we added v-t-c is similar<br>
&lt;emilio> ... so I think we can hide it<br>
&lt;emilio> flackr: I think you can expose the initial style without a name<br>
&lt;emilio> khush: web animations might be weird because you get a list of pseudos and can't differentiate it<br>
&lt;emilio> ... any place the name would have appeared then it'd be replaced with auto<br>
&lt;emilio> flackr: that's one possibility<br>
&lt;emilio> ... maybe there are others<br>
&lt;emilio> ... worth exploring<br>
&lt;emilio> khush: we use ua css to put styles, we need to figure out how the UA css would work<br>
&lt;emilio> flackr: right, but that can be an implementation detail<br>
&lt;astearns> ack fantasai<br>
&lt;emilio> fantasai: I like flackr's suggestion of auto pulling the id if it has an ID and otherwise uses other way of identity<br>
&lt;emilio> q+<br>
&lt;emilio> fantasai: I agree we want to expose randomly generated IDs into author CSS<br>
&lt;emilio> ... they can given it a name if they need to target something<br>
&lt;fantasai> s/want/don't want/<br>
&lt;emilio> khush: attr() didn't ship for reasons<br>
&lt;emilio> fantasai: let's draft some more concrete proposal<br>
&lt;emilio> ... and come back<br>
&lt;emilio> vmpstr: vague resolution is fine and we can come back with details<br>
</details>


-- 
GitHub Notification of comment by css-meeting-bot
Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/8320#issuecomment-2113040820 using your GitHub account


-- 
Sent via github-notify-ml as configured in https://github.com/w3c/github-notify-ml-config

Received on Wednesday, 15 May 2024 17:02:23 UTC