Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions validator-tests/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ corresponding changes in validators.
* [Dialog Must Have Name](dialog-must-have-name.html)
* @axe-core/cli: [Results](dialog-must-have-name-axe.json)
* validator.nu: [Results](dialog-must-have-name-vnu.json)
* [Error message MUST be pertinent](errormessage-hidden-removed.html)
* @axe-core/cli: [Results](errormessage-hidden-removed-axe.json), [bug](https://github.com/dequelabs/axe-core-npm/issues/328)
* [Form MUST have name](form-role-must-have-name.html)
* @axe-core/cli: [Results](form-role-must-have-name-axe.json), [bug](https://github.com/dequelabs/axe-core-npm/issues/329)
* validator.nu: [Results](form-role-must-have-name-vnu.json)
Expand Down
100 changes: 100 additions & 0 deletions validator-tests/errormessage-hidden-removed-axe.json
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",

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Question, non-blocker: Is the query param needed here? It seems like the URL is valid without it. Just curious.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is the file retrieved from aXe. I don't think we should be changing it.

"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"
]
}
]
37 changes: 37 additions & 0 deletions validator-tests/errormessage-hidden-removed.html
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"

@MelSumner MelSumner Jan 31, 2023

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Question, potential blocker: Should an example be included that has no aria-invalid attribute?

From the spec, emphasis mine:

Initially, the object is in a valid state and either has aria-invalid set to false or no aria-invalid attribute, and the element referenced by aria-errormessage is not applicable.

WDYT?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we would if this were a test file for all of aria-errormessage.

However this is only a testfile for the added authors MUST statements in aria 1.2. Without aria-invalid, aria-errormessage is not pertinent so the entire sentence would not apply.

-->

<!-- 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>