dequelabs / axe-core

Accessibility engine for automated Web UI testing
https://www.deque.com/axe/
Mozilla Public License 2.0
6.01k stars 779 forks source link

Consider making 'duplicate-id' rule as best practice #2808

Closed iamrafan closed 3 years ago

iamrafan commented 3 years ago

Currently duplicate-id rule is tagged as WCAG 4.1.1 and F77 only mentions about how AT experience would be impacted if duplicate IDs are used.

We have tested the various duplicate-id failure scenarios for AT experience i,e. using screen readers like NVDA, JAWS, Narrator and Speech recognition software like Dragon NaturallySpeaking & Windows speech recognition. We found that none of the duplicate-id rule failures have an impact on these ATs and other failures which have an impact on ATs fall into either duplicate-id-aria or duplicate-id-active rule failure categories.

Hence, please consider make the duplicate-id rule a best practice rule

Expectation: Tag duplicate-id rule as best practice

Actual: duplicate-id rule is tagged as WCAG 4.1.1

Motivation: There is no screen readers or speech recognition software experience impact on the elements that fail this rule

axe-core version: 4.1.1 
WilcoFiers commented 3 years ago

@iamrafan Duplicate IDs are not allowed by on any HTML element by WCAG 2 success criterion 4.1.1, which says:

In content implemented using markup languages, elements have complete start and end tags, elements are nested according to their specifications, elements do not contain duplicate attributes, and any IDs are unique, except where the specifications allow these features.

This is a clear failure of WCAG. The argument for it is that it ensures a web page is robust, so that future assistive technologies won't be tripped up by it either. Whether or not we find that compelling isn't particularly relevant. This was agreed on in the standard, it was re-affirmed in WCAG 2.1, and unless something very strange happens it will be again in WCAG 2.2. Some work happened in WCAG 2.2 to take it out. I was involved in that. Unfortunately there wasn't enough momentum behind it, so it never made it into any of the drafts.

Axe-core is a testing tool for WCAG, and since this is part of WCAG that can be automated, it should be in axe-core. We split the duplicate-id rule a while back to make it easy for people who aren't as concerned about WCAG normative to turn the rule off or change the tag on it. That's why there are three of them. You are very welcome to do that, but as long as this is part of the latest version of WCAG, I don't think we'll change this in axe-core.

dylanb commented 3 years ago

Last time I tested this with Dragon it was still a problem. Can you share test page(s), test procedures and versions of software please

iamrafan commented 3 years ago

@dylanb From below, please find the pages and versions of software we used for testing

Test Pages:

ATs used for testing:

WilcoFiers commented 3 years ago

I'm going to close this issue. Deque's official position on this is that duplicate IDs anywhere in a page is a failure of WCAG 2.0, success criterion 4.1.1 Parsing. Axe-core is highly configurable, anyone who would prefer to run axe without this rule can turn it of.

iamrafan commented 3 years ago

@WilcoFiers sure, thanks for the update

srai550 commented 1 year ago

https://www.w3.org/WAI/WCAG22/Understanding/parsing.html Can be closed