From 92bcaffebac58bd3ef3de63076f6d891217f7962 Mon Sep 17 00:00:00 2001 From: Shunguo Date: Fri, 3 Nov 2023 14:23:15 -0500 Subject: [PATCH] add test cases #1675 --- .../v4/rules/draggable_alternative_exists.ts | 14 +-- .../src/v4/rules/index.ts | 1 + .../element_draggable.html | 42 ++++--- .../element_dropstop.html | 105 ++++++++++++++++++ .../element_overlaid_hidden_zindex.html | 101 ----------------- 5 files changed, 138 insertions(+), 125 deletions(-) create mode 100755 accessibility-checker-engine/test/v2/checker/accessibility/rules/draggable_alternative_exists_ruleunit/element_dropstop.html delete mode 100755 accessibility-checker-engine/test/v2/checker/accessibility/rules/draggable_alternative_exists_ruleunit/element_overlaid_hidden_zindex.html diff --git a/accessibility-checker-engine/src/v4/rules/draggable_alternative_exists.ts b/accessibility-checker-engine/src/v4/rules/draggable_alternative_exists.ts index 7565db2e7..a91ee918e 100644 --- a/accessibility-checker-engine/src/v4/rules/draggable_alternative_exists.ts +++ b/accessibility-checker-engine/src/v4/rules/draggable_alternative_exists.ts @@ -29,9 +29,10 @@ export let draggable_alternative_exists: Rule = { }, messages: { "en-US": { - "group": "When an element receives focus, it is not entirely covered by other content", - "pass": "The element is not entirely covered by other content", - "potential_obscured": "Confirm that when the element receives focus, it is not covered or, if covered by user action, can be uncovered without moving focus" + "group": "A draggable element must have a \"single pointer\" alternative", + "pass_alternative": "The draggable element \"{0}\" has a \"single pointer\" alternative", + "pass_undraggable": "The element \"{0}\" is not draggable", + "potential_alternative": "Ensure the draggable element \"{0}\" has a \"single pointer\" alternative" } }, rulesets: [{ @@ -57,14 +58,9 @@ export let draggable_alternative_exists: Rule = { //in case the bounds not available if (ruleContext.getAttribute("draggable") === 'true') - if (ruleContext.hasAttribute("ondragstart")) - return RulePotential("potential_alternative", [nodeName]); - else - return RulePotential("potential_draggable", [nodeName]); - + return RulePotential("potential_alternative", [nodeName]); else if (ruleContext.getAttribute("draggable") === 'false') return RulePass("pass_undraggable", [nodeName]); - else return null; } diff --git a/accessibility-checker-engine/src/v4/rules/index.ts b/accessibility-checker-engine/src/v4/rules/index.ts index f9430b5e7..2bb42749f 100644 --- a/accessibility-checker-engine/src/v4/rules/index.ts +++ b/accessibility-checker-engine/src/v4/rules/index.ts @@ -80,6 +80,7 @@ export * from "./debug_paths" export * from "./detector_tabbable" export * from "./dir_attribute_valid" export * from "./download_keyboard_controllable" +export * from "./draggable_alternative_exists" export * from "./element_accesskey_labelled" export * from "./element_accesskey_unique" export * from "./element_attribute_deprecated" diff --git a/accessibility-checker-engine/test/v2/checker/accessibility/rules/draggable_alternative_exists_ruleunit/element_draggable.html b/accessibility-checker-engine/test/v2/checker/accessibility/rules/draggable_alternative_exists_ruleunit/element_draggable.html index c41aeee20..d1651bc4c 100755 --- a/accessibility-checker-engine/test/v2/checker/accessibility/rules/draggable_alternative_exists_ruleunit/element_draggable.html +++ b/accessibility-checker-engine/test/v2/checker/accessibility/rules/draggable_alternative_exists_ruleunit/element_draggable.html @@ -33,41 +33,53 @@ -

This text may be dragged.

+

no draggable defined: This text may be dragged by selection.

+ +

draggable false: This text may be selected and dragged.

+ +

draggable undefined:This text may be selected and dragged.

+ +

draggable true: This text may be dragged.

+ + + + + + +

Drag or move the image into the rectangle:

+ +
+
+ +
+
+ + + + + diff --git a/accessibility-checker-engine/test/v2/checker/accessibility/rules/draggable_alternative_exists_ruleunit/element_overlaid_hidden_zindex.html b/accessibility-checker-engine/test/v2/checker/accessibility/rules/draggable_alternative_exists_ruleunit/element_overlaid_hidden_zindex.html deleted file mode 100755 index ac5812e05..000000000 --- a/accessibility-checker-engine/test/v2/checker/accessibility/rules/draggable_alternative_exists_ruleunit/element_overlaid_hidden_zindex.html +++ /dev/null @@ -1,101 +0,0 @@ - - - - - - - - RPT Test Suite - - - - - -
1
-
2
- - - - -