From e235e9075d554fc2a63c10a4a66707a291e43019 Mon Sep 17 00:00:00 2001 From: eps1lon Date: Wed, 28 Oct 2020 22:41:02 +0100 Subject: [PATCH 1/5] feat: Add aria-dialog-name --- doc/rule-descriptions.md | 1 + lib/rules/aria-dialog-name.json | 13 +++ .../aria-dialog-name/aria-dialog-name.html | 33 +++++++ .../aria-dialog-name/aria-dialog-name.json | 28 ++++++ .../virtual-rules/aria-dialog-name.js | 87 +++++++++++++++++++ test/integration/virtual-rules/index.html | 1 + 6 files changed, 163 insertions(+) create mode 100644 lib/rules/aria-dialog-name.json create mode 100644 test/integration/rules/aria-dialog-name/aria-dialog-name.html create mode 100644 test/integration/rules/aria-dialog-name/aria-dialog-name.json create mode 100644 test/integration/virtual-rules/aria-dialog-name.js diff --git a/doc/rule-descriptions.md b/doc/rule-descriptions.md index 29786f47cc..b6eb304786 100644 --- a/doc/rule-descriptions.md +++ b/doc/rule-descriptions.md @@ -15,6 +15,7 @@ | [area-alt](https://dequeuniversity.com/rules/axe/4.0/area-alt?application=RuleDescription) | Ensures <area> elements of image maps have alternate text | Critical | cat.text-alternatives, wcag2a, wcag111, wcag244, wcag412, section508, section508.22.a | failure, needs review | | [aria-allowed-attr](https://dequeuniversity.com/rules/axe/4.0/aria-allowed-attr?application=RuleDescription) | Ensures ARIA attributes are allowed for an element's role | Critical | cat.aria, wcag2a, wcag412 | failure | | [aria-command-name](https://dequeuniversity.com/rules/axe/4.0/aria-command-name?application=RuleDescription) | Ensures every ARIA button, link and menuitem has an accessible name | Serious | wcag2a, wcag412 | failure, needs review | +| [aria-dialog-name](https://dequeuniversity.com/rules/axe/4.0/aria-dialog-name?application=RuleDescription) | Ensures every ARIA dialog and alertdialog node has an accessible name | Serious | cat.aria, wcag2a, wcag412 | failure, needs review | | [aria-hidden-body](https://dequeuniversity.com/rules/axe/4.0/aria-hidden-body?application=RuleDescription) | Ensures aria-hidden='true' is not present on the document body. | Critical | cat.aria, wcag2a, wcag412 | failure | | [aria-hidden-focus](https://dequeuniversity.com/rules/axe/4.0/aria-hidden-focus?application=RuleDescription) | Ensures aria-hidden elements do not contain focusable elements | Serious | cat.name-role-value, wcag2a, wcag412, wcag131 | failure, needs review | | [aria-input-field-name](https://dequeuniversity.com/rules/axe/4.0/aria-input-field-name?application=RuleDescription) | Ensures every ARIA input field has an accessible name | Moderate, Serious | cat.aria, wcag2a, wcag412 | failure, needs review | diff --git a/lib/rules/aria-dialog-name.json b/lib/rules/aria-dialog-name.json new file mode 100644 index 0000000000..4c6c8945f9 --- /dev/null +++ b/lib/rules/aria-dialog-name.json @@ -0,0 +1,13 @@ +{ + "id": "aria-dialog-name", + "selector": "[role=\"dialog\"], [role=\"alertdialog\"]", + "matches": "no-naming-method-matches", + "tags": ["cat.aria", "wcag2a", "wcag412"], + "metadata": { + "description": "Ensures every ARIA dialog and alertdialog node has an accessible name", + "help": "ARIA dialog and alertdialog nodes must have an accessible name" + }, + "all": [], + "any": ["aria-label", "aria-labelledby", "non-empty-title"], + "none": [] +} diff --git a/test/integration/rules/aria-dialog-name/aria-dialog-name.html b/test/integration/rules/aria-dialog-name/aria-dialog-name.html new file mode 100644 index 0000000000..e18c0fa107 --- /dev/null +++ b/test/integration/rules/aria-dialog-name/aria-dialog-name.html @@ -0,0 +1,33 @@ + + + + +

Cookies

+
+