Re: [csswg-drafts] [css-contain-2] Clarify whether content-visibility: auto subtree elements are visible in accessibility (#5857)

I think this case should help us think through this: in documents like social network feeds, with infinite scrolling and loading of content as you scroll, you sort of have 3 classes of elements: those are are on screen, those have have been loaded but are off-screen, those that haven't been added to the document yet, but will be once you scroll further. The later might have been fetched off the network already and be known to javascript only, or maybe they haven't even been loaded yet. Nonetheless, they are part of the conceptual document, and will eventually be visible, both by user who look at the box tree and those who navigate via the accessibility-tree. But until they are actually loaded into the DOM, they are invisible to both. For short, I'll call these off-DOM elements.

While elements with `content-visibility:hidden` (not `auto` as discussed in this issue) are in the DOM, they are closer to off-DOM elements (or `display:none` elements): not searchable, not tabbable, not focusable, etc. So it makes sense for them not to be reachable via the accessibility tree, as is the case for `display: none` elements.

Elements with `content-visibility:auto` are closer to off-screen elements than to off-DOM elements, as they can be searched, focused, tabbed to… So logically, they ought to be accessible through the accessibility tree as well.

The reason it's been suggested that they should be skipped is that applying styles, which is necessary to resolve things like `display:none` and other things that affect the accessibility tree, is expensive, and we'd rather skip that.

But I don't believe this argument holds, and we actually need to do the styling anyway, regardless of the accessibility tree situation: find-in-page also depends on `display:none`. So does tabbing, focusing, or selecting which are explicitely allowed on `content-visibility:auto` elements. So while we might not need to *layout* the `content-visibility:auto` subtree, we do need to style it anyway. and if we're going that far, there's no need to do anything unusual for the accessibility tree.

I think `content-visibility: hidden-matchable`, as proposed in https://github.com/w3c/csswg-drafts/issues/5595, would be the hard case, where it's much more ambiguous as to whether it's closer of off-screen or off-DOM , but this third state hasn't been accepted into css.

-- 
GitHub Notification of comment by frivoal
Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/5857#issuecomment-801607168 using your GitHub account


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

Received on Thursday, 18 March 2021 04:11:07 UTC