axe-core icon indicating copy to clipboard operation
axe-core copied to clipboard

False positives when using aria-roledescription

Open tesk9 opened this issue 3 years ago • 1 comments

Product

axe-core

Product Version

4.4.3

Latest Version

  • [X] I have tested the issue with the latest version of the product

Issue Description

Expectation

aria-roledescription should be allowed on any element that has "a valid WAI-ARIA role or has an implicit WAI-ARIA role," according to ARIA 1.1's roledescription section

Actual

I believe that the checks for aria-roledescription limit the supported WAI-ARIA roles to:

"supportedRoles": [
      "button",
      "img",
      "checkbox",
      "radio",
      "combobox",
      "menuitemcheckbox",
      "menuitemradio"
    ]

which leaves out a fair number of roles, including the "region" role that's used in the ARIA 1.1. example of a "slide".

How to Reproduce

Provide a code sample or link to a webpage that reproduces the issue. Without this, your issue may be closed without investigation.

Add the following HTML node to a page: <mark aria-roledescription="Claim highlight">Bats are vital pollinators</mark>

Run axe devtools or any of the other tools that use axe-core, and you'll get an error: Screen Shot of axe devtools output with Issue 'Ensure aria-roledescription is only used on elements with an implicit or explicit role' highlighting `mark[aria-roledescription='Claim highlight']`

tesk9 avatar Sep 07 '22 22:09 tesk9

Thanks for the issue. When we created the check two years ago, assistive technologies didn't support it very well for non-interactive elements. That may have changed in the past years, so we can recheck support.

straker avatar Sep 08 '22 15:09 straker

After rechecking, the attribute is fully supported so we'll disable the rule and deprecate it..

straker avatar Mar 20 '23 21:03 straker

Thanks!

tesk9 avatar Mar 20 '23 21:03 tesk9

Validated with the latest axe-core develop branch code base, aria-roledescription is deprecated , so that with the latest axe.run is not showing aria-roledescription with the below code snippet:

 <p aria-roledescription="my paragraph" id="fail1">paragraph</p>
<div aria-roledescription="my div" id="fail2">div</div>
<div
  role="presentation"
  aria-roledescription="my presentation"
  id="fail3"
></div>
<div role="none" aria-roledescription="my none" id="fail4"></div>

Where with the earlier axe version (let us 4.6.3 production version) we can see the failure for aria-roledescription

Image

padmavemulapati avatar Mar 28 '23 09:03 padmavemulapati