Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update duplicate-id rules to align with WCAG 2.2 #3892

Closed
WilcoFiers opened this issue Jan 25, 2023 · 8 comments · Fixed by #3957, #4071 or #4075
Closed

Update duplicate-id rules to align with WCAG 2.2 #3892

WilcoFiers opened this issue Jan 25, 2023 · 8 comments · Fixed by #3957, #4071 or #4075
Assignees
Labels
deprecation feat New feature or enhancement pr A pr has been created for the issue rules Issue or false result from an axe-core rule standards Issues in the ARIA standards objects (lib/standards)
Milestone

Comments

@WilcoFiers
Copy link
Contributor

WilcoFiers commented Jan 25, 2023

In WCAG 2.2, success criterion 4.1.1 has been removed. This raises lots of questions on how to handle that in axe-core. Here's my proposal on how this should effect axe-core. I'm looking for feedback on this approach:

duplicate-id-aria

This rule fails when a duplicate ID is used in ARIA, or in form labelling. The result of it can be that controls have incorrect names, or that other relationships are incorrect. Per the standard, only the first of an ID in a page is valid. So if the first ID happens to be the correct one then there's no accessibility problem. If not, then there is almost certainly some issue, but without SC 4.1.1 to report to it is difficult to say what it actually is. This rule reports serious issues.

  • Replace the wcag2a tag with a wcag2a-obsolete tag.
  • Add the best-practice tag, so that this rule will only run when best practices are turned on

Future: We've been talking about possibly replacing this rule with a more focused idref-labels-and-aria rule that doesn't just look at duplicates, but considers whether based on DOM order that's likely to cause an accessibility problem. As part of resolving this issue we should have a proposal of that rule written.

duplicate-id

It is a technical failure of WCAG SC 4.1.1 Parsing, but in practice it has no impact on accessibility. Axe-core reports these as minor issues.

  • Deprecate and disable the duplicate-id rule by default. This rule will not run unless explicitly configured, and will be removed in axe-core 5.0.
  • Replace the wcag2a tag with a wcag2a-obsolete tag.

duplicate-id-active

This rule was created to catch a problem with Dragon Naturally Speaking, where if active controls like buttons shared an ID, Dragon could activate the first element with that ID, even if you asked it to activate the second. Axe reports this as a serious issue. After some testing we've discovered this problem no longer exists. So for this rule we'll deprecate and tag it the same way we're doing for duplicate-id.

@WilcoFiers WilcoFiers added feat New feature or enhancement rules Issue or false result from an axe-core rule deprecation standards Issues in the ARIA standards objects (lib/standards) labels Jan 25, 2023
@WilcoFiers WilcoFiers added this to the Axe-core 4.7 milestone Jan 25, 2023
@dbjorge
Copy link
Contributor

dbjorge commented Jan 26, 2023

I agree 100% with your proposals for duplicate-id and duplicate-id-active. We already disable duplicate-id in Accessibility Insights because it generates a lot of noise with no practical impact on accessibility. I think your assessment of duplicate-id-active makes sense.

duplicate-id-aria is a little tougher - it's likely enough to indicate a violation of 1.3.1 that I could see leaving the wcag2a tag in place against that SC, but I understand the position that it's questionable to turn it on as a non-best-practice when it will knowingly generate false positives in the event that the first id is the correct one. I don't really have a better idea than leaving it around as best-practice. I just did a spot check through a random 10 failures of this rule in our most recent big-test-corpus run and found that 10/10 were true positives, so I think this rule is still valuable in practice. From our standpoint in Accessibility Insights, I'd probably advocate for us to at least keep running the rule as what we call a "Needs Review" case.

@straker straker added the pr A pr has been created for the issue label Mar 23, 2023
@padmavemulapati
Copy link

Validated with the latest code base of axe-core
duplicate-id & duplicate-id-active deprecated and if we wanted to see the results for duplicate-id and duplicate-id-active , we should run with runOptions()

Image

Image

@WilcoFiers WilcoFiers reopened this Apr 14, 2023
@WilcoFiers
Copy link
Contributor Author

This should not have been closed. duplidate-id-aria has not been updated.

@WilcoFiers WilcoFiers modified the milestones: Axe-core 4.7, Axe-core 4.8 Apr 17, 2023
@mgifford
Copy link
Contributor

So we're not going to see duplicate-id-active & duplicate-id in 4.8, and we'll see duplicate-id-aria with just a wcag131 tag, right?

@WilcoFiers
Copy link
Contributor Author

For anyone following along, here's the blogpost I wrote on this issue:
https://www.deque.com/blog/wcag-2-2-removes-4-1-1-parsing-and-how-axe-core-is-impacted/

@WilcoFiers
Copy link
Contributor Author

Wasn't all done yet

@dbjorge
Copy link
Contributor

dbjorge commented Jun 30, 2023

This part of the original issue description:

Future: We've been talking about possibly replacing this rule with a more focused idref-labels-and-aria rule that doesn't just look at duplicates, but considers whether based on DOM order that's likely to cause an accessibility problem. As part of resolving this issue we should have a proposal of that rule written.

...is being tracked as #4076

@padmavemulapati
Copy link

Validated with the latest axe-core/canary build(develop branch code base)
dupicate-id-aria is now in incomplete and updated the success criteria to 4.1.2 from 4.1.1 as per the WCAG2.2

(It was failing earlier and holding wcag411)

Screen.Recording.2023-07-05.at.8.22.30.AM.mov

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
deprecation feat New feature or enhancement pr A pr has been created for the issue rules Issue or false result from an axe-core rule standards Issues in the ARIA standards objects (lib/standards)
Projects
None yet
5 participants