Re: [csswg-drafts] [css-view-transitions-2] scoped VT: we should apply content-visibility: hidden for the duration of capture (#13428)

The CSS Working Group just discussed `[css-view-transitions-2] scoped VT: we should apply content-visibility: hidden for the duration of capture`, and agreed to the following:

* ``RESOLVED: Behave as `contain: size` + `contain-intrinsic-size: auto` for the duration of scoped view transition capture + change callback``

<details><summary>The full IRC log of that discussion</summary>
&lt;emilio> vmpstr: we initially proposed to add `content-visibility: hidden` for the view transition capture<br>
&lt;emilio> ... emilio raised some issues<br>
&lt;emilio> ... did some research, for the most part I think everything is fine except the accessibility tree would be removed<br>
&lt;emilio> ... I'd like to change the proposal to instead say that we apply `content-visibility: auto` except we also consider that element to be offscreen<br>
&lt;emilio> ... which means it'll remain in the a11y tree, we can apply `contain-intrinsic-size: auto`<br>
&lt;emilio> ... and that's about it, everything else that `content-visibility: auto` would do seems fine<br>
&lt;emilio> q+<br>
&lt;emilio> astearns: how long does the capture frame take?<br>
&lt;another-astearns> ack fantasai<br>
&lt;emilio> vmpstr: the dom callback is async but the capture is a frame or two<br>
&lt;flackr> q+<br>
&lt;emilio> vmpstr: typical case would be 16/30ms<br>
&lt;another-astearns> ack emilio<br>
&lt;fantasai> emilio: Can you remind me why do we want to do this?<br>
&lt;fantasai> ... If it's just to prevent authoring mistakes with the DOM changes, that's fine maybe<br>
&lt;fantasai> ... But it feels both pretty special-casey, and, the content-visiblity: auto behavior seems weird<br>
&lt;fantasai> ... If you transition something where you have [?] suddenly it feels really different<br>
&lt;fantasai> ... That doesn't seem uncommon to do<br>
&lt;emilio> vmpstr: the intent is to prevent size / layout changes of partial updates to be visible outside of the participating scope<br>
&lt;emilio> ... if your callback changes the size of some element inside it'll affect content outside<br>
&lt;emilio> ... you're right that focus would make the behavior different<br>
&lt;fantasai> emilio: In DOM callback, you make a bunch of DOM mutations that trigger relayout outside your subtree<br>
&lt;fantasai> ... I thought ?? would take care of it?<br>
&lt;fantasai> [missed]<br>
&lt;another-astearns> s/??/contain:size/<br>
&lt;fantasai> emilio: Seems like something like contain:size would be needed<br>
&lt;fantasai> ??: You can definitely contain the intrinsic size with contain-intrinsic-size: auto;<br>
&lt;emilio> vmpstr: I think you definitely can apply contain: size with contain-intrinsic-size: auto<br>
&lt;emilio> chrishtr: doesn't that amount to the same thing as content-visibility: auto?<br>
&lt;fantasai> chrishtr: content-visibility: auto would take care of it, the point is to avoid doing layout<br>
&lt;emilio> vmpstr: the exception is that you can apply that regardless of content-visibility: auto<br>
&lt;emilio> flackr: if it's focused you don't want to start changing size<br>
&lt;emilio> vmpstr: the unfortunate thing is you don't get the optimizations of not doing rendering<br>
&lt;emilio> chrishtr: the proposal is to apply contain: size even if it had these overrides<br>
&lt;emilio> vmpstr: so both contain-intrinsic-size: auto + contain: size<br>
&lt;emilio> flackr: visually content is not going to change until v-t starts?<br>
&lt;emilio> vmpstr: right<br>
&lt;emilio> chrishtr: if we do these two things then we can do these optimizations?<br>
&lt;emilio> vmpstr: there's implications for animations starting or not starting<br>
&lt;astearns> q+<br>
&lt;emilio> ... the reason I wanted content-visibility is that if you want the rendering optimizations there's a bunch of the small things you need to consider<br>
&lt;emilio> ... you'd need to consider all the same cases as content-visiblity<br>
&lt;emilio> ... I'd like contain: size, but I don't think it'd be possible to do the optimizations then<br>
&lt;emilio> chrishtr: but doesn't that amount to content-visibility: hidden then?<br>
&lt;emilio> vmpstr: no, because the content would remain in the a11y tree<br>
&lt;emilio> ack flackr<br>
&lt;emilio> ack astearns<br>
&lt;emilio> astearns: since we don't have exactly the switch you need... can we define this as "this is what should happen in this duration"<br>
&lt;emilio> ... don't try to express it as css<br>
&lt;emilio> q+<br>
&lt;emilio> ... I think we're going to play whack-a-mole for this weird case<br>
&lt;emilio> vmpstr: I think we can start with `contain: size` + `contain-intrinsic-size: auto`<br>
&lt;flackr> +1<br>
&lt;emilio> ... that'd solve the immediate problem, then revise if we need rendering optimizations<br>
&lt;astearns> ack emilio<br>
&lt;emilio> +1 to vmpstr, it seems content-visibility: auto would have some side effects that might be hard to reason about<br>
&lt;emilio> PROPOSED: Use `contain: size` + `contain-intrinsic-size: auto` for the duration of scoped view transition capture + change callback<br>
&lt;emilio> chrishtr: and we'll come back to the group if we missed something?<br>
&lt;emilio> vmpstr: we need to do those for sure, we might need other stuff for rendering optimizations<br>
&lt;emilio> vmpstr: do we plan to do this via magic rather than changing the computed style right?<br>
&lt;emilio> emilio: we have some magic that changes `contain`s used value so seems ok<br>
&lt;emilio> PROPOSED: Behave as `contain: size` + `contain-intrinsic-size: auto` for the duration of scoped view transition capture + change callback<br>
&lt;emilio> RESOLVED: Behave as `contain: size` + `contain-intrinsic-size: auto` for the duration of scoped view transition capture + change callback<br>
</details>


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


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

Received on Wednesday, 15 July 2026 16:33:52 UTC