fix(a11y): treat inert elements and content outside of modal dialogs as hidden
Merged
DG
1mo ago+496+496+012345678901234567890123456789-32-32-01234567890123456789
Summary
- Elements with the
inertattribute, their descendants, and everything outside of the topmost modal<dialog>are now hidden for aria: excluded fromgetByRole(), aria snapshots and accessible names, with no refs in the AI snapshot. - New internal "not inert" actionability check for click-like actions and
fill(), so they wait instead of silently misfiring. PLAYWRIGHT_SKIP_INERT_CHECKdisables all inert checks,PLAYWRIGHT_SKIP_DIALOG_CHECKdisables only the modal dialog check.
Fixes https://github.com/microsoft/playwright/issues/36938
Fixes https://github.com/microsoft/playwright/issues/42967
Related earlier attempts:
- https://github.com/microsoft/playwright/pull/36947, reverted in https://github.com/microsoft/playwright/pull/37137
- https://github.com/microsoft/playwright/pull/37155 (snapshots only, closed)
- https://github.com/microsoft/playwright/pull/42990 (input actions only, closed)