From ba6bde28120c73ff321240ab729f81d968b3a9ac Mon Sep 17 00:00:00 2001 From: Shunguo Date: Wed, 13 Sep 2023 15:33:58 -0500 Subject: [PATCH] update rule and test case #1539 --- .../aria_activedescendant_tabindex_valid.ts | 5 ++- .../activedescendant_blank_tabbable.html | 41 +++++++++++++++++++ 2 files changed, 44 insertions(+), 2 deletions(-) create mode 100755 accessibility-checker-engine/test/v2/checker/accessibility/rules/aria_activedescendant_tabindex_valid_ruleunit/activedescendant_blank_tabbable.html diff --git a/accessibility-checker-engine/src/v4/rules/aria_activedescendant_tabindex_valid.ts b/accessibility-checker-engine/src/v4/rules/aria_activedescendant_tabindex_valid.ts index 62b5e70f2..852ad46aa 100644 --- a/accessibility-checker-engine/src/v4/rules/aria_activedescendant_tabindex_valid.ts +++ b/accessibility-checker-engine/src/v4/rules/aria_activedescendant_tabindex_valid.ts @@ -62,8 +62,9 @@ export let aria_activedescendant_tabindex_valid: Rule = { return null; } - //check if the attribute 'aria-activedescendant' is valid for the role of the element - + //ignore if the attribute 'aria-activedescendant' is blank + if (ruleContext.getAttribute("aria-activedescendant").trim().length === 0) + return; // If the tabindex attribute is provided then verify that it is 0 or -1 passed = RPTUtil.isTabbable(ruleContext); diff --git a/accessibility-checker-engine/test/v2/checker/accessibility/rules/aria_activedescendant_tabindex_valid_ruleunit/activedescendant_blank_tabbable.html b/accessibility-checker-engine/test/v2/checker/accessibility/rules/aria_activedescendant_tabindex_valid_ruleunit/activedescendant_blank_tabbable.html new file mode 100755 index 000000000..53a980821 --- /dev/null +++ b/accessibility-checker-engine/test/v2/checker/accessibility/rules/aria_activedescendant_tabindex_valid_ruleunit/activedescendant_blank_tabbable.html @@ -0,0 +1,41 @@ + + + + + + + Sandbox + + + + +
+

Test page

+ +
+ + + \ No newline at end of file