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

Bug: axe-core/cli validator does not give warning about lack of aria-label or aria-labelledby on role="img" element(ARIA 1.2 ) #316

Closed
spectranaut opened this issue Aug 4, 2021 · 1 comment

Comments

@spectranaut
Copy link

Product: cli

Motivation:

ARIA 1.2 introduces the following imperative in the role="img" definition: In order for elements with a role of img to be perceivable, authors MUST provide a label using the aria-label or aria-labelledby attribute.

Replication of error:

If you run the AXE cli (axe-core 4.3.2 in chrome-headless) on an HTML with the following HTML::

<div id="img-1" role="img"></div>

<div id="img-2" role="img" title="Image 2 description"></div>

<div id="img-3" role="img">Image 3 description</div>

You will see the following errors:

  Violation of "role-img-alt" with 2 occurrences!
    Ensures [role='img'] elements have alternate text. Correct invalid elements at:
     - #img-1
     - #img-3
    For details, see: https://dequeuniversity.com/rules/axe/4.3/role-img-alt

Expectation:

Two errors:

  1. You should see an error on all three, because none of the images have an "aria-label" or "aria-labelledby" attribute.
  2. I think the error for this scenario should be under --tags cat.aria, but it is not, you see know errors if you run the CLI with --tags cat.aria
@Zidious
Copy link
Contributor

Zidious commented Sep 7, 2021

Thank you for finding this issue!

I have raised this within axe-core ref: dequelabs/axe-core#3153

@Zidious Zidious closed this as completed Sep 7, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants