Skip to content

fix(aria-valid-attr-value): handle multiple aria-errormessage IDs#4973

Merged
straker merged 9 commits intodequelabs:developfrom
JustasMonkev:fix/aria-errormessage-multiple-idrefs-4957
Jan 26, 2026
Merged

fix(aria-valid-attr-value): handle multiple aria-errormessage IDs#4973
straker merged 9 commits intodequelabs:developfrom
JustasMonkev:fix/aria-errormessage-multiple-idrefs-4957

Conversation

@JustasMonkev
Copy link
Contributor

When aria-errormessage contains multiple space-separated IDs, the check now correctly verifies that all IDs are present in aria-describedby instead of failing to match the entire string against tokenized values.

Closes: #4957

@JustasMonkev JustasMonkev requested a review from a team as a code owner December 27, 2025 06:04
@CLAassistant
Copy link

CLAassistant commented Dec 27, 2025

CLA assistant check
All committers have signed the CLA.

@JustasMonkev JustasMonkev changed the title fix(checks): handle multiple ID tokens in aria-errormessage with aria… fix(checks): handle multiple ID tokens in aria-errormessage Dec 27, 2025
@JustasMonkev JustasMonkev changed the title fix(checks): handle multiple ID tokens in aria-errormessage fix(checks): handle multiple aria-errormessage IDs Dec 27, 2025
@straker
Copy link
Contributor

straker commented Jan 5, 2026

Thanks for the pr. Unfortunately it isn't an accessibility violation if all the aria-describedby ids are not present. As long as one exists then we want to pass this check.

@JustasMonkev
Copy link
Contributor Author

Thanks for the pr. Unfortunately it isn't an accessibility violation if all the aria-describedby ids are not present. As long as one exists then we want to pass this check.

Thanks for the comment, updated it

@JustasMonkev
Copy link
Contributor Author

@straker could you please check again?

@straker
Copy link
Contributor

straker commented Jan 22, 2026

Sorry for the delay. I've been out of office and so haven't had time to look at this. After discussing this with the team here is what we are thinking.

Testing multiple aria-errormessage ids with various screen readers and browsers, only JAWS/Chrome supports this. NVDA/Firefox only announces the first id, while VoiceOver/Safari doesn't announce any. This means that even if multiple ids are supported by the spec, only JAWS/Chrome actually support it. When cases such as this happen with ARIA attributes, we typically report this as "unsupported" and that it's not widely supported by screen readers.

Taking that into consideration, as well as the various edge cases that would need to be handled to support multiple ids (what happens if the first id isn't on the page but all others are, what happens if the last id is the only one on the page, etc.), we feel it's best to report multiple ids on aria-errormessage as unsupported.

What this would mean is that we would update the aria-errormessage check to provide a new failure message of "Multiple IDs in aria-errormessage is not widely supported in assistive technologies" and in the evaluate function check if the tokenList of aria-errormessage contains more than 2 entires, and if so set the this.data({ message: 'unsupported' }) and return false.

@JustasMonkev
Copy link
Contributor Author

Sorry for the delay. I've been out of office and so haven't had time to look at this. After discussing this with the team here is what we are thinking.

Testing multiple aria-errormessage ids with various screen readers and browsers, only JAWS/Chrome supports this. NVDA/Firefox only announces the first id, while VoiceOver/Safari doesn't announce any. This means that even if multiple ids are supported by the spec, only JAWS/Chrome actually support it. When cases such as this happen with ARIA attributes, we typically report this as "unsupported" and that it's not widely supported by screen readers.

Taking that into consideration, as well as the various edge cases that would need to be handled to support multiple ids (what happens if the first id isn't on the page but all others are, what happens if the last id is the only one on the page, etc.), we feel it's best to report multiple ids on aria-errormessage as unsupported.

What this would mean is that we would update the aria-errormessage check to provide a new failure message of "Multiple IDs in aria-errormessage is not widely supported in assistive technologies" and in the evaluate function check if the tokenList of aria-errormessage contains more than 2 entires, and if so set the this.data({ message: 'unsupported' }) and return false.

Thanks for the comment, updated it

Copy link
Contributor

@straker straker left a comment

Choose a reason for hiding this comment

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

Thanks for the changes. This is almost done but needs a few more tests. There should be an integration test or 2 in aria-valid-attr-value that tests multiple ids on aria-errormessage returns false. To do this add the HTML to the file with a unique id, then add that ID to the corresponding JSON file in the violations section.

@JustasMonkev
Copy link
Contributor Author

Thanks for the changes. This is almost done but needs a few more tests. There should be an integration test or 2 in aria-valid-attr-value that tests multiple ids on aria-errormessage returns false. To do this add the HTML to the file with a unique id, then add that ID to the corresponding JSON file in the violations section.

Added the tests

@JustasMonkev JustasMonkev requested a review from straker January 23, 2026 19:29
@JustasMonkev JustasMonkev requested a review from straker January 26, 2026 18:45
Copy link
Contributor

@straker straker left a comment

Choose a reason for hiding this comment

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

Awesome, thanks again for all the help!

Reviewed for security

@straker straker changed the title fix(checks): handle multiple aria-errormessage IDs fix(aria-valid-attr-value): handle multiple aria-errormessage IDs Jan 26, 2026
@straker straker merged commit 0489e30 into dequelabs:develop Jan 26, 2026
22 of 23 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

aria-valid-attr-value does not correctly handle multiple id tokens for aria-errormessage with aria-describedby

3 participants