From 364eb72bb8f20b0ffc31be24cc96cbd349c301cb Mon Sep 17 00:00:00 2001 From: Steven Lambert <2433219+straker@users.noreply.github.com> Date: Tue, 15 Oct 2024 09:10:56 -0600 Subject: [PATCH] fix(button-name,input-button-name,input-img-alt): allow label to give accessible name (#4607) I'm not sure if this should close #4472 as that also deals with buttons with a different role running `button-name`. For sure this closes #3696 Closes: #3696 --------- Co-authored-by: Wilco Fiers --- lib/checks/label/explicit.json | 4 +- lib/checks/label/implicit.json | 4 +- lib/commons/text/native-text-methods.js | 5 +- lib/rules/button-name.json | 2 + lib/rules/input-button-name.json | 2 + lib/rules/input-image-alt.json | 9 +- locales/_template.json | 8 +- test/commons/text/native-text-methods.js | 14 ++ .../rules/button-name/button-name.html | 4 + .../rules/button-name/button-name.json | 4 +- .../input-button-name/input-button-name.html | 4 + .../input-button-name/input-button-name.json | 4 +- .../input-image-alt/input-image-alt.html | 4 + .../input-image-alt/input-image-alt.json | 9 +- test/integration/virtual-rules/button-name.js | 132 ++++++++++++------ .../virtual-rules/input-button-name.js | 123 ++++++++++++---- .../virtual-rules/input-image-alt.js | 90 +++++++++--- 17 files changed, 321 insertions(+), 101 deletions(-) diff --git a/lib/checks/label/explicit.json b/lib/checks/label/explicit.json index ab765720f8..0d4c4b0997 100644 --- a/lib/checks/label/explicit.json +++ b/lib/checks/label/explicit.json @@ -4,8 +4,8 @@ "metadata": { "impact": "critical", "messages": { - "pass": "Form element has an explicit