Re: [csswg-drafts] [css-contain] content-visibility: auto visibility check timing needs details (#8542)

The CSS Working Group just discussed `[css-contain] content-visibility: auto visibility check timing needs details`.

<details><summary>The full IRC log of that discussion</summary>
&lt;TabAtkins> vmpstr: emilio raised that the language in the current Contain spec is hard to implement<br>
&lt;TabAtkins> vmpstr: specifically, the behavior of content-visiblity:auto elements when determining visibility<br>
&lt;TabAtkins> vmpstr: intended behavior is that the very first time we determine vis, that determination happens sync, and if it changes the state of the visibility, the style/layout pass happen sync with it so the first frame is consistent and correct<br>
&lt;TabAtkins> vmpstr: Adding content-vis:auto on an element alreayd in the viewport would otherwise cause a flash of blank, because the typical (non-first) determination of visibility is deferred to next frame<br>
&lt;TabAtkins> vmpstr: In my last comment in issue, I tried to propose spec changes to capture this rigorously<br>
&lt;TabAtkins> vmpstr: Proposal is to adopt that text<br>
&lt;TabAtkins> emilio: I agenda+'d befor eyou added that comment, thanks for writing it<br>
&lt;TabAtkins> emilio: Specifics of timing are observable in different ways<br>
&lt;TabAtkins> emilio: iiuc, the way chrome does it fires right before ResizeObserver<br>
&lt;TabAtkins> emilio: scroll events, anchoring, etc all see this<br>
&lt;TabAtkins> emilio: I'd love if someone from WK could go over this and confirm it's fine<br>
&lt;TabAtkins> emilio: I'm not opposed to doing this just before RO, just want to make sure it's interop<br>
&lt;flackr> https://github.com/w3c/csswg-drafts/issues/8694 is also related<br>
&lt;flackr> q+<br>
&lt;TabAtkins> emilio: I find it a bit unfortunate we can't just use an IO to explain how this behavior, but I understand the use-case of appending<br>
&lt;astearns> ack flackr<br>
&lt;TabAtkins> flackr: I linked a related issue for scroll anims, the determination of frames can depend on alyout and we don't want the flash either<br>
&lt;TabAtkins> flackr: We should think thru before/after RO for that other use-case too. I specifically put it *after* because the user-defined sizing might affect things we want to respond to<br>
&lt;TabAtkins> flackr: But for c-v i'm concerned it might go both ways. An RO might make something visible, but also people might want RO positioning to rely on correct c-v.<br>
&lt;TabAtkins> emilio: Right, and in Chrome right now if you append a c-v:auto element within an RO, it just won't work, right?<br>
&lt;TabAtkins> vmpstr: If you make a new element in an RO callback it works in the same way, it hits the RO for that call in the same loop<br>
&lt;TabAtkins> vmpstr: The RO itself causes a flash of rendering, so if it changes things we do sync run style/layout<br>
&lt;TabAtkins> emilio: Oh so this also happens if you gBCR() on the element, you get new size?<br>
&lt;TabAtkins> vmpstr: I don't.... believe so? At least not per spec<br>
&lt;TabAtkins> vmpstr: To address why we wanted it before, we just don't really want to add a lot of script determining visibility/rendering. But if you put RO before, you get script running that can observe it.<br>
&lt;TabAtkins> emilio: It feels like this needs a bit more care. Maybe done along the RO loop somehow?<br>
&lt;TabAtkins> emilio: From what you wrote, I understood - in partiuclar the second-to-lst sentence you wrote "this always happens in lifecycle before RO steps", it sounded like a new lifecycle step, but it seem syou're not doing that if appending an el in an RO causes this to run somehow<br>
&lt;TabAtkins> astearns: Take back to the issue, then?<br>
&lt;TabAtkins> emilio: think that's fine, and again if someone from WK could look it would be great<br>
&lt;TabAtkins> smfr: I saw it. Agree that the interactions are hard to understand, maybe just have to implement to see what's happening.<br>
&lt;TabAtkins> smaug: I agree that using IO in a way that differs from the web version is weird - makes me question why authors can't get a non-flashing IO too?<br>
&lt;TabAtkins> emilio: that's fair<br>
&lt;TabAtkins> astearns: Let's close discussion and take it back to the issue, please add comments on what you'd like to see changed<br>
</details>


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


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

Received on Wednesday, 12 April 2023 16:54:19 UTC