fix(a11y): track inert elements as hidden in snapshots only #37155
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Expands on #36947 to only apply breaking changes to ARIA snapshots and not general visibility checks.
Resolves #36938.
Implement the somewhat vague
inertHTML attribute spec for our accessibility tree.My interpretation is that nodes are marked hidden, equivalent to
aria-hidden, if they possess theinertattribute. 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
falseflag toinert, just the absence of the attribute). The spec lists modaldialogs as an example of a tag that escapesinert.This opt out behavior is not supported by this PR