question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

role=presentation not recognized as valid

See original GitHub issue

Expectation: Using role=presentation (or role=none) in img passes. Example:

Actual: If no ALT is being used, the error returns “Ensures elements have alternate text or a role of none or presentation” - if role=presentation is used, the error returns “ARIA role must be appropriate for the element”. The same happens, when role=none is being used. Example code = <img src="https://dummyimage.com/340x160/444/888" role="presentation">

Motivation: I do not want to use alt=“” in each presentational img and use its proper role.


axe-core version: 3.3.1
axe-extension (Chrome) version: 3.9.0

Browser and Assistive Technology versions 
Browser : Chrome version: 76.0.3809.100
System : Mac OSX version: 10.13.6

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:5 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
chandana7393commented, Oct 22, 2019

Tested, working as expected. role_presentation_best_practice

Tested Environment: Axe-coconut - 4.0.0.29504v Chrome - 77.0.3865.120v OS - Windows 10 64 bit.

1reaction
AutoSpongecommented, Oct 9, 2019

Per spec

img with no alt=""	role=img	
Any role

Global aria-* attributes and any aria-* attributes applicable to the allowed roles and implied role (if any).

I’m reading this as the “missing” spec per Wilco’s comment.

Read more comments on GitHub >

github_iconTop Results From Across the Web

html - role="presentation" on button not working in firefox and ...
I might be wrong but setting aria-expanded="false" on the container ( <li> ) should at least be valid and hide the content from...
Read more >
ARIA: presentation role - Accessibility - MDN Web Docs - Mozilla
The presentation role and its synonym none remove an element's implicit ARIA semantics from being exposed to the accessibility tree.
Read more >
Accessibility rule: Ensure elements marked as presentational ...
Checks every element with role=“none” or role=“presentation” to ensure they do not have a global ARIA attribute and are not focusable. Learn more:....
Read more >
WAI-ARIA: role=presentation - DigitalA11Y
In this case, the user agent ignores the presentation role and exposes the element according to its implicit native semantics. However, user ...
Read more >
Role attribute has valid value[proposed] | ACT Rule | WAI - W3C
This rule assumes that elements with a role attribute have their intended structure and relationship conveyed through some sort of presentation. If it...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found