Programmatically hidden doesn't handle CSS content-visibility: and hidden=until-found
There are new ways to show/hide content:
CSS content-visibility: property
content-visibility: hiddenremoves an element's contents from the screen and a11y tree (seems easy to resolve)content-visibility: autoadds elements withdisplay: noneback into a11y tree (might be harder to address)
See https://developer.mozilla.org/en-US/docs/Web/CSS/content-visibility#accessibility
Supported from Chrome/Edge 85 onwards. Not supported in Firefox/Safari
The current definition of Programmatically Hidden doesn't take content-visibility into account
Note: also affects whether an element can be focused or selected, so may impact focus definitions.
HTML hidden=until-found attribute
A new value has been added to the hidden attribute in HTML - it's no longer a boolean attribute. This makes hidden elements searchable via the browser Find command, and automatically shows then when found. This lets you search text in accordions and similar widgets.
https://github.com/WICG/display-locking/blob/main/explainers/hidden-content-explainer.md https://html.spec.whatwg.org/multipage/interaction.html#the-hidden-attribute https://developer.chrome.com/articles/hidden-until-found/
This was added to the Living Standard on 23 March 2022, and is not yet documented on MDN. Supported from Chrome 102.
How should elements with hidden=until-found be treated in rules?
🤔 Quick look through them:
hidden="until-found": I think we're fairly safe without it, since it should be rendered withcontent-visibility: hidden(same thing ashidden="true"anddisplay: none). Additionally, hidden until found state says: "When these features attempt to scroll to a target which is in the element's subtree, the user agent will remove the hidden attribute in order to reveal the content before scrolling to it.", so we can be fairly confident that it shouldn't impact snapshots of the page in a given state (what ACT rules test).content-visibility: hidden: should indeed be programmatically hidden since it seems to bedispaly: nonewith some special powers.content-visibility: auto: from what I read on MDN, it feels like we should consider it as not programmatically hidden. The Accessibility note states that the content is still in the accessibility tree.
So, it seems we need to:
- Add
content-visibility: hiddento the list. - Likely add a not that
hidden="until-found"triggerscontent-visibility: hiddenthe same way thathiddentriggersdisplay: none.