-
Notifications
You must be signed in to change notification settings - Fork 363
IDREFs that refer to an ambiguous ID should be an error #141
Comments
@dmazzoni-google your code examples are not displaying, but agree that flagging mulitple id's as an issue is generally not an accessibility issue, though it is a HTML conformance error. The twist is that depending on the state of a document, an id value may or not be referenced in a relation so it is difficult to know when duplicate id's are problematic or not. |
Alice and I discussed this a while back (see #102) and ended up writing an audit to cover this. In terms of whether to only audit "used" ids or determine which ones are relevant to a11y I think this comment from the audit code explains our reasoning on it:
It's basically exactly what @stevefaulkner said. EDIT: the version of the extension currently available in the webstore is not up to date with the latest version of the accessibility developer tools library, that is why it is currently not reporting duplicate IDs. It's up to @alice to determine when it should be updated but I'm thinking it's looking pretty good (maybe after we action PR #138 ;) ) FYI I fixed up the original comment from @dmazzoni-google so that the code example would display. |
Since this test is so noisy I'm now convinced by @dmazzoni-google's reasoning. IDREFs in the same scope really should be unique, otherwise there is no point having them, but it is indeed the case that automatically generated code often generates non-unique IDREFs and it is harmless unless something attempts to refer to that ID. Since there is a finite number of situations in which IDREFs may be used, perhaps we should follow @dmazzoni-google's original suggestion of finding all the cases where an IDREF is specified and make sure that each one refers to exactly one element (unless the element is aria-hidden or not rendered). |
Closes issue #141 - only audit IDs in IDREFs
Some accessibility audits give a warning if you have two elements on the page with the same id even if it's never used, and I think that's silly. It just wastes people's time in cases where it's not actually being used.
However, I think that code like this should be an error, since there's a label with an IDREF and there are multiple controls with that same id.
The text was updated successfully, but these errors were encountered: