-
Notifications
You must be signed in to change notification settings - Fork 125
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
aria-errormessage is hidden or removed when not pertinent (#1588)
Co-authored-by: Valerie Young <[email protected]> Co-authored-by: James Nurthen <[email protected]>
- Loading branch information
1 parent
e262b4a
commit 11902fc
Showing
3 changed files
with
139 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,100 @@ | ||
[ | ||
{ | ||
"description": "Ensures all ARIA attributes have valid values", | ||
"help": "ARIA attributes must conform to valid values", | ||
"helpUrl": "https://dequeuniversity.com/rules/axe/4.3/aria-valid-attr-value?application=webdriverjs", | ||
"id": "aria-valid-attr-value", | ||
"impact": "critical", | ||
"nodes": [ | ||
{ | ||
"all": [ | ||
{ | ||
"data": [ | ||
"id-message-1" | ||
], | ||
"id": "aria-errormessage", | ||
"impact": "critical", | ||
"message": "aria-errormessage value `id-message-1` must use a technique to announce the message (e.g., aria-live, aria-describedby, role=alert, etc.)", | ||
"relatedNodes": [] | ||
} | ||
], | ||
"any": [], | ||
"failureSummary": "Fix all of the following:\n aria-errormessage value `id-message-1` must use a technique to announce the message (e.g., aria-live, aria-describedby, role=alert, etc.)", | ||
"html": "<input type=\"text\" id=\"input-1\" aria-invalid=\"true\" aria-errormessage=\"id-message-1\" class=\"fail\">", | ||
"impact": "critical", | ||
"none": [], | ||
"target": [ | ||
"#input-1" | ||
] | ||
}, | ||
{ | ||
"all": [ | ||
{ | ||
"data": [ | ||
"id-message-2" | ||
], | ||
"id": "aria-errormessage", | ||
"impact": "critical", | ||
"message": "aria-errormessage value `id-message-2` must use a technique to announce the message (e.g., aria-live, aria-describedby, role=alert, etc.)", | ||
"relatedNodes": [] | ||
} | ||
], | ||
"any": [], | ||
"failureSummary": "Fix all of the following:\n aria-errormessage value `id-message-2` must use a technique to announce the message (e.g., aria-live, aria-describedby, role=alert, etc.)", | ||
"html": "<input type=\"text\" id=\"input-2\" aria-invalid=\"true\" aria-errormessage=\"id-message-2\" class=\"fail\">", | ||
"impact": "critical", | ||
"none": [], | ||
"target": [ | ||
"#input-2" | ||
] | ||
}, | ||
{ | ||
"all": [ | ||
{ | ||
"data": [ | ||
"id-message-3" | ||
], | ||
"id": "aria-errormessage", | ||
"impact": "critical", | ||
"message": "aria-errormessage value `id-message-3` must use a technique to announce the message (e.g., aria-live, aria-describedby, role=alert, etc.)", | ||
"relatedNodes": [] | ||
} | ||
], | ||
"any": [], | ||
"failureSummary": "Fix all of the following:\n aria-errormessage value `id-message-3` must use a technique to announce the message (e.g., aria-live, aria-describedby, role=alert, etc.)", | ||
"html": "<input type=\"text\" id=\"input-3\" aria-invalid=\"true\" aria-errormessage=\"id-message-3\" class=\"fail\">", | ||
"impact": "critical", | ||
"none": [], | ||
"target": [ | ||
"#input-3" | ||
] | ||
}, | ||
{ | ||
"all": [ | ||
{ | ||
"data": [ | ||
"id-message-7" | ||
], | ||
"id": "aria-errormessage", | ||
"impact": "critical", | ||
"message": "aria-errormessage value `id-message-7` must use a technique to announce the message (e.g., aria-live, aria-describedby, role=alert, etc.)", | ||
"relatedNodes": [] | ||
} | ||
], | ||
"any": [], | ||
"failureSummary": "Fix all of the following:\n aria-errormessage value `id-message-7` must use a technique to announce the message (e.g., aria-live, aria-describedby, role=alert, etc.)", | ||
"html": "<input type=\"text\" id=\"input-7\" aria-invalid=\"true\" aria-errormessage=\"id-message-7\" class=\"pass\">", | ||
"impact": "critical", | ||
"none": [], | ||
"target": [ | ||
"#input-7" | ||
] | ||
} | ||
], | ||
"tags": [ | ||
"cat.aria", | ||
"wcag2a", | ||
"wcag412" | ||
] | ||
} | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
<html lang="en-US"> | ||
<head><title>When aria-errormessage is pertinent, authors MUST ensure the content is not hidden so users can navigate to and examine the error message</title></head> | ||
<body> | ||
|
||
<!-- | ||
URL: https://www.w3.org/TR/wai-aria-1.2/#aria-errormessage | ||
RULE: " Authors MUST use aria-invalid in conjunction with aria-errormessage and when aria-errormessage is pertinent, authors MUST ensure the content is not hidden so users can navigate to and examine the error message" | ||
--> | ||
|
||
<!-- inputs with aria-errormessage that should fail --> | ||
|
||
<input type="text" id="error-message-hidden-1" aria-invalid="true" aria-errormessage="id-message-1" class="fail"></div> | ||
<div id="id-message-1" hidden>Error message 1</div> | ||
|
||
<input type="text" id="error-message-hidden-2" aria-invalid="true" aria-errormessage="id-message-2" class="fail"></div> | ||
<div id="id-message-2" style="display: none">Error message 2</div> | ||
|
||
<input type="text" id="error-message-hidden-3" aria-invalid="true" aria-errormessage="id-message-3" class="fail"></div> | ||
<div id="id-message-3" style="visibility: hidden">Error message 3</div> | ||
|
||
<!-- inputs with aria-errormessage that should pass --> | ||
|
||
<input type="text" id="aria-invalid-value-false-1" aria-invalid="false" aria-errormessage="id-message-4" class="pass"></div> | ||
<div id="id-message-4" hidden>Error message 4</div> | ||
|
||
<input type="text" id="aria-invalid-value-false-2" aria-invalid="false" aria-errormessage="id-message-5" class="pass"></div> | ||
<div id="id-message-5" style="display: none">Error message 5</div> | ||
|
||
<input type="text" id="aria-invalid-value-false-3" aria-invalid="false" aria-errormessage="id-message-6" class="pass"></div> | ||
<div id="id-message-6" style="visibility: hidden">Error message 6</div> | ||
|
||
<input type="text" id="aria-invalid-visible-1" aria-invalid="true" aria-errormessage="id-message-7" class="pass"></div> | ||
<div id="id-message-7">Error message 7</div> | ||
|
||
</body> | ||
</html> | ||
|