Skip to content

Conversation

@agg23
Copy link
Contributor

@agg23 agg23 commented Aug 22, 2025

Expands on #36947 to only apply breaking changes to ARIA snapshots and not general visibility checks.

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

@agg23 agg23 requested a review from dgozman August 22, 2025 16:46
@github-actions
Copy link
Contributor

Test results for "tests 1"

3 flaky ⚠️ [firefox-library] › library/inspector/cli-codegen-1.spec.ts:1079 › cli codegen › should not throw csp directive violation errors `@firefox-ubuntu-22.04-node18`
⚠️ [firefox-page] › page/page-emulate-media.spec.ts:144 › should keep reduced motion and color emulation after reload `@firefox-ubuntu-22.04-node18`
⚠️ [playwright-test] › ui-mode-trace.spec.ts:397 › should work behind reverse proxy `@macos-latest-node18-1`

46633 passed, 805 skipped


Merge workflow run.

@dgozman
Copy link
Contributor

dgozman commented Aug 25, 2025

I'm not sure we should diverge getByRole() and toMatchAriaSnapshot(). I am fine to diverge snapshotForAI() though - will that work?

@agg23
Copy link
Contributor Author

agg23 commented Aug 27, 2025

We've decided we don't want this breaking change.

@agg23 agg23 closed this Aug 27, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: Elements with an inert="" attribute aren't hidden from the accessibility tree

2 participants