From a64781d6b7352281a5518fa362cb08806d2be997 Mon Sep 17 00:00:00 2001 From: Simon Holthausen Date: Mon, 19 Jun 2023 14:02:06 +0200 Subject: [PATCH] chore: a11y tests cleanup closes #8728 Turns out all the removed previous test failures are indeed correct to be removed, according to the test adjustments in https://github.com/jsx-eslint/eslint-plugin-jsx-a11y/pull/937 --- .../svelte/src/compiler/compile/utils/a11y.js | 3 +- .../input.svelte | 56 +- .../warnings.json | 60 +-- .../input.svelte | 12 +- .../warnings.json | 490 ++++-------------- 5 files changed, 164 insertions(+), 457 deletions(-) diff --git a/packages/svelte/src/compiler/compile/utils/a11y.js b/packages/svelte/src/compiler/compile/utils/a11y.js index 563d5bfb64c5..74a679b543e7 100644 --- a/packages/svelte/src/compiler/compile/utils/a11y.js +++ b/packages/svelte/src/compiler/compile/utils/a11y.js @@ -14,7 +14,8 @@ const non_interactive_roles = new Set( // aria-activedescendant, thus in practice we treat it as a widget. // focusable tabpanel elements are recommended if any panels in a set contain content where the first element in the panel is not focusable. // 'generic' is meant to have no semantic meaning. - !['toolbar', 'tabpanel', 'generic'].includes(name) && + // 'cell' is treated as CellRole by the AXObject which is interactive, so we treat 'cell' it as interactive as well. + !['toolbar', 'tabpanel', 'generic', 'cell'].includes(name) && !role.superClass.some((classes) => classes.includes('widget')) ); }) diff --git a/packages/svelte/test/validator/samples/a11y-no-interactive-element-to-noninteractive-role/input.svelte b/packages/svelte/test/validator/samples/a11y-no-interactive-element-to-noninteractive-role/input.svelte index 47dec07d6361..6729890c59e8 100644 --- a/packages/svelte/test/validator/samples/a11y-no-interactive-element-to-noninteractive-role/input.svelte +++ b/packages/svelte/test/validator/samples/a11y-no-interactive-element-to-noninteractive-role/input.svelte @@ -21,37 +21,37 @@ - - - - - - - - - + + + + + + + + + - - - - - + + + + -