From 0e0063c1f8798f47068252537f9e08d3b00f47e5 Mon Sep 17 00:00:00 2001 From: Jey Date: Tue, 13 Nov 2018 10:49:37 +0000 Subject: [PATCH] feat: separate form-field-multiple-label from label rule (#1226) --- doc/rule-descriptions.md | 3 +- lib/checks/label/multiple-label.json | 6 +- lib/rules/form-field-multiple-labels.json | 19 ++++ lib/rules/label.json | 1 - test/integration/rules/label/label.html | 3 +- test/integration/rules/label/label.json | 1 - .../rules/multiple-label/multiple-label.html | 86 +++++++++++++++++++ .../rules/multiple-label/multiple-label.json | 22 +++++ 8 files changed, 133 insertions(+), 8 deletions(-) create mode 100644 lib/rules/form-field-multiple-labels.json create mode 100644 test/integration/rules/multiple-label/multiple-label.html create mode 100644 test/integration/rules/multiple-label/multiple-label.json diff --git a/doc/rule-descriptions.md b/doc/rule-descriptions.md index 25aa0af0f3..c2c4653255 100644 --- a/doc/rule-descriptions.md +++ b/doc/rule-descriptions.md @@ -28,6 +28,7 @@ | duplicate-id | Ensures every id attribute value is unique | Minor | cat.parsing, wcag2a, wcag411 | true | | empty-heading | Ensures headings have discernible text | Minor | cat.name-role-value, best-practice | true | | focus-order-semantics | Ensures elements in the focus order have an appropriate role | Minor | cat.keyboard, best-practice, experimental | true | +| form-field-multiple-labels | Ensures form field does not have multiple label elements | Moderate | cat.forms, wcag2a, wcag332 | true | | frame-tested | Ensures <iframe> and <frame> elements contain the axe-core script | Critical | cat.structure, review-item | true | | frame-title-unique | Ensures <iframe> and <frame> elements contain a unique title attribute | Serious | cat.text-alternatives, best-practice | true | | frame-title | Ensures <iframe> and <frame> elements contain a non-empty title attribute | Serious | cat.text-alternatives, wcag2a, wcag241, wcag412, section508, section508.22.i | true | @@ -40,7 +41,7 @@ | image-redundant-alt | Ensure button and link text is not repeated as image alternative | Minor | cat.text-alternatives, best-practice | true | | input-image-alt | Ensures <input type="image"> elements have alternate text | Critical | cat.text-alternatives, wcag2a, wcag111, section508, section508.22.a | true | | label-title-only | Ensures that every form element is not solely labeled using the title or aria-describedby attributes | Serious | cat.forms, best-practice | true | -| label | Ensures every form element has a label | Minor, Serious, Critical | cat.forms, wcag2a, wcag332, wcag131, section508, section508.22.n | true | +| label | Ensures every form element has a label | Minor, Critical | cat.forms, wcag2a, wcag332, wcag131, section508, section508.22.n | true | | landmark-banner-is-top-level | Ensures the banner landmark is at top level | Moderate | cat.semantics, best-practice | true | | landmark-contentinfo-is-top-level | Ensures the contentinfo landmark is at top level | Moderate | cat.semantics, best-practice | true | | landmark-main-is-top-level | Ensures the main landmark is at top level | Moderate | cat.semantics, best-practice | true | diff --git a/lib/checks/label/multiple-label.json b/lib/checks/label/multiple-label.json index 9ec5f3c07f..9aca78d646 100644 --- a/lib/checks/label/multiple-label.json +++ b/lib/checks/label/multiple-label.json @@ -2,10 +2,10 @@ "id": "multiple-label", "evaluate": "multiple-label.js", "metadata": { - "impact": "serious", + "impact": "moderate", "messages": { - "pass": "Form element does not have multiple