Re: [csswg-drafts] [css-view-transitions-1] Capturing fragmented elements (#8339)

The CSS Working Group just discussed `[css-view-transitions-1] Capturing fragmented elements`, and agreed to the following:

* `RESOLVED: if an element if fragmented into more than one element, it does not participate in View Transitions (plus note that we want to do such things in the future)`

<details><summary>The full IRC log of that discussion</summary>
&lt;emeyer> Topic: [css-view-transitions-1] Capturing fragmented elements<br>
&lt;emeyer> github: https://github.com/w3c/csswg-drafts/issues/8339<br>
&lt;emeyer> JakeA: When an element is captured as part of a transition, we ignore all the transforms and then figure out what transforms we need to apply to place it correctly<br>
&lt;emeyer> …so if the transition is a 90 deg rotation, you get a rotating transition<br>
&lt;emeyer> …The columns case is particularly interesting because you can apply transitions across fragments, which transitions each fragment individually<br>
&lt;emeyer> …That’s not compatible with the View Transitions model, which we want to be a single image and single transform<br>
&lt;emeyer> …It’s unclear to us if View Transitions are desirable in fragmented cases<br>
&lt;emeyer> …Prior art indicated fragmented elements should be treated as if joined flush<br>
&lt;emeyer> …We looked at Firefox’s implementation; it seems to capture the union of the fragments before a transition is applied<br>
&lt;emeyer> TabAtkins: That’s per-spec<br>
&lt;emeyer> JakeA: Good to know Firefox is doing the right thing<br>
&lt;emeyer> khush: I was confused bewtween what old specs said and what Firefox does<br>
&lt;emeyer> TabAtkins: The capturing of dimensions is spec-compliant; other things may not be<br>
&lt;emeyer> JakeA: Trying to figure out View Transitions in this case<br>
&lt;emeyer> …Option 1: You Are Not Allowed; the captured element must not fragment, which means you skip to the end of the transition<br>
&lt;emeyer> …Is a constraint broken when an element fragment, or if an element ever can fragment<br>
&lt;emeyer> …Previous resolutions have been that if a constraint can be broken, then the treatment is as if it has been broken<br>
&lt;emeyer> …If you’ve given a name a none-none value, should it prevent an element from being fragmented?<br>
&lt;emeyer> …Option 2: View Transition only applies to the first fragment; doesn’t seem useful, but could be done<br>
&lt;emeyer> …Option 3: Take a bit from the element() function and remove any transform from the elemenbt, figure out union of fragment quads, reapply transform to each fragment and capture image with that transform baked in<br>
&lt;emeyer> …Not sure if that’s useful, but it’s a non-failing treatment<br>
&lt;vmpstr> q+<br>
&lt;emeyer> …We’re stuck here.<br>
&lt;astearns> ack vmpstr<br>
&lt;TabAtkins> q+<br>
&lt;emeyer> vmpstr: One of the constraints we have is that the element has a box, so we don’t check if the element can lose its box; we only care whether it has a box<br>
&lt;emeyer> …I prefer option 1, because as you said this adds a lot of complexity to both model and implementation<br>
&lt;emeyer> …I don]t think there are compelling use cases to transition a fragmented element<br>
&lt;emeyer> …You could work around by putting a box around the fragmented element<br>
&lt;khush> +1 to Vlad's comment.<br>
&lt;astearns> ack TabAtkins<br>
&lt;emeyer> TabAtkins: I also think Option 1 is probably the right idea<br>
&lt;dbaron> +1 to not doing something complex if there aren't actual use cases for it.  (I think that most strongly says "not Option 3".)<br>
&lt;emeyer> …none of the options are great, but I don’t think there is a good way to do it<br>
&lt;emeyer> …I think making thing with view transitions not-fragmentable makes sense<br>
&lt;florian> q+ to disagree with making non fragmentable<br>
&lt;astearns> also disagree with making things non-fragmentable<br>
&lt;emeyer> fantasai: The problem is a people will apply this to a lot of elements and if you force things to be not-fragmentable they’ll break in print<br>
&lt;emeyer> …I would just not go down this path; the problem here is the combination o f fragmentation and transforms<br>
&lt;emeyer> …if you capture the bounding box and say this is a the view transition snapshot, that’s okay<br>
&lt;astearns> ack dbaron<br>
&lt;Zakim> dbaron, you wanted to react to TabAtkins<br>
&lt;emeyer> dbaron: We seem to be focused on Tab’s variant of Jake’s option 1, not the original option 1<br>
&lt;emeyer> astearns: I think we’re agree Tab’s variant is Right Out<br>
&lt;florian> q-<br>
&lt;astearns> ack fantasai<br>
&lt;khush> I'd be ok with that. Ignore the element if it fragments.<br>
&lt;TabAtkins> It feels a little unpredictable, but I think I'm okay with the "just don't VT if it's fragmenting"<br>
&lt;astearns> q+<br>
&lt;florian> q+<br>
&lt;TabAtkins> q+<br>
&lt;emeyer> fantasai: We could not transition when fragmented, or take the bounding box and transition the whole thing, which will interact weirdly with transforms<br>
&lt;emeyer> astearns: I’m fine with not transitioning view-fragmented things, but I’m concerned this is like other things we’ve punted for being too complicated and then never got back to<br>
&lt;fantasai> fantasai^: but would let you do simple transitions like translations or fades<br>
&lt;emeyer> …We already have the optoin to apply a view transition to multiple elements, so we could treat fragmented elements as if they created separate view transitions<br>
&lt;emeyer> JakeA: The difficulty there is how you’d address each fragment with CSS, and what do you do if the number of fragments changes<br>
&lt;emeyer> astearns: I wouldn’t expect being ablke to address each fragment directly<br>
&lt;fantasai> s/directly/directly, until we have fragment pseudos (which we have talked about)/<br>
&lt;emeyer> …As in regular view transitions, if you have an element that appears in one state but not the other, it doesn’t participate<br>
&lt;astearns> ack astearns<br>
&lt;astearns> ACK florian<br>
&lt;emeyer> florian: I agree with dbaron and fantasi<br>
&lt;emeyer> …Another concern: a user agent that’s interactive but paginates is not common today, but there are things like e-readers that could do that, and we don’t want a model incompatible with that<br>
&lt;jensimmons> q+<br>
&lt;emeyer> …It’s hard to make a union of things that don’t share the same coordinate space, like columns<br>
&lt;astearns> ack TabAtkins<br>
&lt;emeyer> TabAtkins: That union of non-oriented coordinate spaces is why element() stitches them together<br>
&lt;emeyer> …line-box-clamp could intersect with this; it’s at least fragmentation-adjacent<br>
&lt;emeyer> …I think option 2, transitioning the first fragment, is the best choice<br>
&lt;khush> q+<br>
&lt;emeyer> …I think it’s better to get some of the element rather than none of the element during a transition<br>
&lt;emeyer> astearns: If we fragment the first box, we’ll find out if people want other fragments to transition<br>
&lt;emeyer> JakeA: Different transitions names for different fragments would be a nice way to address that<br>
&lt;astearns> ack jensimmons<br>
&lt;emeyer> jensimmons: +1 to actually solving this and taking it seriously<br>
&lt;emeyer> …I can see a future where simple and elegant transitions make it so web sites use a lot of transitions to go between pages and even sites<br>
&lt;chrishtr> +1 to solving both<br>
&lt;fantasai> "using overflow fragments to solve the regions use case"<br>
&lt;emeyer> …We also need to figure out overflow fragments to solve the Regions use case, and make ihs and view transitions work together<br>
&lt;emeyer> JakeA: I would worry that because we don]t know how the regions thing will work, we might pick a solution today that clashes<br>
&lt;astearns> ack khush<br>
&lt;emeyer> khush: As an implementor, if we ignore a fragmented element, the fallback is you get a crossfade rather than a nice animation<br>
&lt;emeyer> …I think I prefer we either ignore the element if it’s fragmented, or we use the first fragment, I’d be okay with either<br>
&lt;emeyer> …Doing a union like element() does, we could try, but I really want to see how that pans out<br>
&lt;astearns> ack fantasai<br>
&lt;emeyer> fantasai: If we take option 2 and go back to Alan’s idea, we could apply the same transition to all the fragments that is being applied to the first fragment<br>
&lt;khush> q+<br>
&lt;vmpstr> q+<br>
&lt;emeyer> …In the future, we might be able to address each fragment individually, through something like :nth-fragment<br>
&lt;emeyer> …I think Alan’s proposal is the best going forward, but it’s not the easiest to implement<br>
&lt;emeyer> …We could start with first-fragment use, and leave the door open to individual-fragment later<br>
&lt;astearns> ack khush<br>
&lt;emeyer> khush: I think the problem is the View Transition API has a way to address fragments individually<br>
&lt;emeyer> fantasai: The selector would select all of them<br>
&lt;emeyer> JakeA: We could ask for the devloper to give view transition names to each fragment, and we could ignore in the meantime<br>
&lt;emeyer> fantasai: The whole element has a name, and we could use :nth-fragment<br>
&lt;astearns> ack vmpstr<br>
&lt;emeyer> ???: Would that mean the pseudo representing these elements is itself fragmented?<br>
&lt;JakeA> vmpstr:<br>
&lt;emeyer> fantasai: I’m not sure of the distrinction<br>
&lt;emeyer> vmpstr: So the new selector would select both, but they would be their own fragments?<br>
&lt;emeyer> JakeA: My understanding is if you give a name to an element, we’ll operate on the first fragment, but we can use :nth-fragment to address fragments?<br>
&lt;emeyer> fantasai: You can transition an &lt;article> element, and then transition that element<br>
&lt;emeyer> …Each fragment gets snapshotted<br>
&lt;emeyer> JakeA: So what happens if you give an individual fragment a view transition name?<br>
&lt;emeyer> fantasai: I suppose you could do that<br>
&lt;emeyer> astearns: I like the idea of individually transitioning fragments, but don’t know if it’s useful to do before we have fragment pseudos<br>
&lt;emeyer> …That seems like the path forward<br>
&lt;flackr> I think the ideal would be if you have an element that has n fragments transition to another element with n fragments it pairs them up?<br>
&lt;emeyer> …Not transitioning fragmented elements is a way of saying we’ll address this in the future, but don’t want to have a suboptimal solution now<br>
&lt;emeyer> JakeA: I like it<br>
&lt;emeyer> astearns: Any arguments that it would be better to transition the first fragment, rather than none?<br>
&lt;emeyer> (silence)<br>
&lt;JakeA> +1<br>
&lt;khush> sounds good<br>
&lt;emeyer> astearns: Proposed resolution is that if an element if fragmented into more than one element, it does not participate in View Transitions<br>
&lt;emeyer> RESOLVED: if an element if fragmented into more than one element, it does not participate in View Transitions (plus note that we want to do such things in the future)<br>
&lt;khush> Next one is easier... I hope. :P<br>
</details>


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


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

Received on Wednesday, 15 March 2023 15:38:35 UTC