fix(a11y): track inert elements as hidden

Merged
AG
1y ago
+31-5

Resolves #36938.

Implement the somewhat vague inert HTML attribute spec for our accessibility tree.

My interpretation is that nodes are marked hidden, equivalent to aria-hidden, if they possess the inert attribute. This cascades to all "flat tree descendants", which are the standard descendants plus special handling for shadow DOM.

Some nodes can additionally opt out (by virtue of their tag, not by specifying a property, as it is not possible to supply an explicit false flag to inert, just the absence of the attribute). The spec lists modal dialogs as an example of a tag that escapes inert.

This opt out behavior is not supported by this PR