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

aria-allowed-role rule false positive for <img> with no alt but with accessible name #3143

Closed
kospl opened this issue Sep 1, 2021 · 7 comments
Assignees
Labels
fix Bug fixes pr A pr has been created for the issue rules Issue or false result from an axe-core rule
Milestone

Comments

@kospl
Copy link

kospl commented Sep 1, 2021

Product: axe-core

Expectation: <img> with role button and accessible name is a valid element.

Actual: axe core 4.3.3 reports it as a violation of aria-allowed-role rule.

Motivation: as described in https://www.w3.org/TR/html-aria/#el-img-no-alt <img> with no alt but WITH accessible name may have same roles as https://www.w3.org/TR/html-aria/#el-img including button.


axe-core version: 4.3.3

Browser and Assistive Technology versions: Chrome/92.0.4515.159

For Tooling issues:
- Platform:  Windows

Repro minimal example:

<img role="button" aria-label="Search">

axe.run({
  runOnly: ['aria-allowed-role']
}, function (err, results) {
  console.log(results.violations);
});

Result (axe-core 4.3.3):

image

@straker
Copy link
Contributor

straker commented Sep 1, 2021

EDIT Sorry, looking at the wrong row (too early for me :) ). Will look further into this

@kospl
Copy link
Author

kospl commented Sep 2, 2021

Related code block for noAlt removed about year ago, not sure why, but I think it has something to do with this false positive.

@Zidious Zidious self-assigned this Oct 19, 2021
@Zidious Zidious added pr A pr has been created for the issue rules Issue or false result from an axe-core rule labels Oct 19, 2021
@WilcoFiers WilcoFiers added the fix Bug fixes label Oct 21, 2021
@TechThomas
Copy link

Hi @WilcoFiers and @Zidious we are happy to see a fix is coming in. Once you all checkin and merge the code we can run a test on our side to make sure the issue is resolved. Thank you!

@WilcoFiers WilcoFiers added this to the Axe-core 4.4 milestone Nov 10, 2021
@straker straker removed this from the Axe-core 4.4 milestone Nov 10, 2021
@WilcoFiers WilcoFiers added this to the Axe-core 4.4 milestone Dec 14, 2021
@padmavemulapati
Copy link

Validated with the latest axe-core dev branch code base,
Test snippet:

<img role="button" aria-label="Search">
  <img role="button" alt="foo" /> 
<img role="button" aria-label="foo" /> 

image

Not finding any failures.

@kospl
Copy link
Author

kospl commented Dec 15, 2021

Yeah, some work have been done, but still fix is absent in all axe tools other than dev, that's why this issue is still open.

@padmavemulapati
Copy link

Yeah, some work have been done, but still fix is absent in all axe tools other than dev, that's why this issue is still open.

@kospl Sure , No problem , I have validated with dev branch code base. Will open it until fix is available in the production

@WilcoFiers
Copy link
Contributor

Nope, sorry. Our policy is to close the issue after QA has confirmed the issue is resolved in the develop branch. @kospl, this fix will be in the next released, which its currently looking will be the 4.4 release on January 31st.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
fix Bug fixes pr A pr has been created for the issue rules Issue or false result from an axe-core rule
Projects
None yet
Development

No branches or pull requests

6 participants