Skip to content

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

@kospl

Description

@kospl

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

Metadata

Metadata

Assignees

Labels

fixBug fixesprA pr has been created for the issuerulesIssue or false result from an axe-core rule

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions