w3c / accname

Accessible Name and Description Computation
https://w3c.github.io/accname/
61 stars 23 forks source link

Proposal: do not follow aria-labelledby/aria-describedby into content-visibility:hidden #146

Open aleventhal opened 2 years ago

aleventhal commented 2 years ago

Short version: a helpful performance optimization is to avoid creating accessible subtrees for content-visibility:hidden roots.

Long version: There is no O(1) way to determine when a node is content-visibility:hidden. It involves walking up the parent chain to the root, checking each node. This is because of the nature of content-visibility:hidden.

In general, content:visibility-hidden is an optimization used to hide large swaths of content. It's more optimal than display:none in the non-a11y case, because if the node becomes visible and then hidden again, it keeps any useful style/layout/paint info it can in case the node becomes visible again. However, it's not really the CSS markup one would expect to see for an ARIA label or description.

Unlike content-visibility:auto, I don't see any reason to create accessible objects for content-visibility:hidden nodes.

a11ydoer commented 2 years ago

Info content visibility on mdn

jnurthen commented 2 years ago

Removing Agenda as this needs a more detailed proposal to progress