From 2add3129ccbe2f2ad7046f70c559129f1063252e Mon Sep 17 00:00:00 2001 From: Tim Fischbach Date: Tue, 23 Sep 2025 09:48:04 +0200 Subject: [PATCH] feat(ByRole): Treat inert subtrees as hidden in role queries https://html.spec.whatwg.org/multipage/interaction.html#inert-subtrees: Inert nodes generally cannot be focused, and user agents do not expose the inert nodes to accessibility APIs or assistive technologies. Since jsdom does not yet fully support the `inert` attribute [1], we use `element.hasAttribute('inert')` instead of `element.inert`. fixes #1364 [1] https://github.com/jsdom/jsdom/issues/3605 --- src/__tests__/role-helpers.js | 1 + src/__tests__/role.js | 19 +++++++++++++++++++ src/role-helpers.js | 4 ++++ 3 files changed, 24 insertions(+) diff --git a/src/__tests__/role-helpers.js b/src/__tests__/role-helpers.js index f47daa42..3735a352 100644 --- a/src/__tests__/role-helpers.js +++ b/src/__tests__/role-helpers.js @@ -205,6 +205,7 @@ test.each([ ['
', true], ['
', true], ['