Re: [csswg-drafts] [css-contain-2] API to expose skipped content state (#9474)

The CSS Working Group just discussed `[css-contain-2] API to expose skipped content state`, and agreed to the following:

* `RESOLVED: Extend checkVisibility to expose content-visibility: auto state`

<details><summary>The full IRC log of that discussion</summary>
&lt;emilio> ntim: in Safari we have some reader detection code that does some visual analysis and performs layout in different subtrees<br>
&lt;emilio> ... we want an API to be able to skip hidden content for visual analysis<br>
&lt;emilio> ... because otherwise it cancels out optimizations<br>
&lt;vmpstr> q+<br>
&lt;emilio> ... ideally it'd cover content-visibility: auto and hidden<br>
&lt;emilio> q+<br>
&lt;astearns> ack khush<br>
&lt;emilio> ack khush<br>
&lt;astearns> ack vmpstr<br>
&lt;emilio> vmpstr: checkVisibility was close to cover this use case<br>
&lt;emilio> ... it deals with c-v: hidden<br>
&lt;emilio> ... I'd suggest extending checkVisibility<br>
&lt;emilio> ... content-visibility: auto content remains accessible to find-in-page / tab-navigation / etc so it's not "hidden hidden"<br>
&lt;emilio> ... so not sure if it'd be consistent with the model<br>
&lt;emilio> ntim: you can kinda query it with the statechange event<br>
&lt;emilio> ... but it's less convenient and you might miss some events<br>
&lt;astearns> ack emilio<br>
&lt;miriam> scribe+<br>
&lt;miriam> emilio: not opposed<br>
&lt;emilio> ... and I agree with vmpstr on extending checkVisibility<br>
&lt;emilio> ... but curious about the use case because it seems reader-mode should care about content-visibility: auto<br>
&lt;miriam> emilio: to check size you need to layout<br>
&lt;emilio> ntim: so we have a check for the element being small and skipping the content<br>
&lt;emilio> ... and the rest of the code doesn't care about layout<br>
&lt;emilio> ... but actually slows down the website because it lays out the skipped subtrees<br>
&lt;vmpstr> q?<br>
&lt;vmpstr> q+<br>
&lt;emilio> ntim: could be a separate method on checkVisibility even<br>
&lt;miriam> emilio: The element could be large, and you need to lay it out<br>
&lt;miriam> … kinda silly not to expose this<br>
&lt;emilio> ... it's a bit weird that with the statechange event being async you can observe an element being hidden before the state change arrives<br>
&lt;emilio> ... might cause some subtle bugs<br>
&lt;emilio> ... but anyhow it seems fine to expose<br>
&lt;emilio> q?<br>
&lt;astearns> ack vmpstr<br>
&lt;emilio> vmpstr: just to answer emilio, I don't think it's unique to this<br>
&lt;emilio> ... intersectionobserver has the same issue, where you could do your own math via gBCR<br>
&lt;emilio> ... I'd like to suggest not reusing checkVisibility for this<br>
&lt;emilio> q+<br>
&lt;miriam> emilio: why?<br>
&lt;emilio> vmpstr: to me the problematic word there is visibility<br>
&lt;emilio> ... because if you consider things like a11y it's there<br>
&lt;emilio> ... so claiming it's not visible is not entirely accurate<br>
&lt;emilio> ... visibility is a little overloaded<br>
&lt;astearns> ack emilio<br>
&lt;miriam> emilio: but that's true of all the other things CV checks<br>
&lt;miriam> ... things with opacity 0 are still in the visibility tree<br>
&lt;miriam> … as long as you opt in for content visibility auto, seems like you need to check that anyway<br>
&lt;emilio> vmpstr: I guess opacity would be similar to this, yeah, the other's won't<br>
&lt;emilio> astearns: seems there's consensus on exposing this, but not in whether to change checkVisibility or something else<br>
&lt;emilio> ... might be worth resolving on that and discussing the other thing in the issue<br>
&lt;emilio> fantasai: was going to say the same thing as emilio, checkVisibility is already a misnomer and was designed with this extension in mind<br>
&lt;emilio> ntim: I don't feel strongly either way<br>
&lt;vmpstr> +1<br>
&lt;emilio> RESOLVED: Extend checkVisibility to expose content-visibility: auto state<br>
</details>


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


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

Received on Wednesday, 18 October 2023 16:26:13 UTC