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

alt="" is treated as valid alt text #4711

Closed
1 task done
adamraine opened this issue Feb 20, 2025 · 1 comment
Closed
1 task done

alt="" is treated as valid alt text #4711

adamraine opened this issue Feb 20, 2025 · 1 comment
Labels
ungroomed Ticket needs a maintainer to prioritize and label

Comments

@adamraine
Copy link

Product

axe-core

Product Version

4.10.2

Latest Version

  • I have tested the issue with the latest version of the product

Issue Description

Expectation

I expected axe to flag image elements which have alt=""

Actual

Axe does not flag image elements with alt=""

How to Reproduce

Generate an axe report of https://thelibre.news/would-you-pay-for-free-software/

Several images don't have any real alt text if you do the query document.querySelectorAll('img[alt=""]'), but axe does not flag them.

Additional context

GoogleChrome/lighthouse#16346

@adamraine adamraine added the ungroomed Ticket needs a maintainer to prioritize and label label Feb 20, 2025
@WilcoFiers
Copy link
Contributor

Thank you for reporting this issue. I understand your expectation that axe should flag images with alt="", but I want to explain why this is working as intended. In HTML, alt="" explicitly indicates that the image is decorative and should be ignored by screen readers, which is the correct way to mark decorative images according to WCAG SC 1.1.1.

Axe-core cannot determine if an image is decorative or informative. There is no reliable way to detect this, therefor axe-core cannot fail informative images that are marked up as decorative or vice versa. This is an unavoidable limitation of the technology. Axe-core can automatically find 57% of WCAG 2.0 issues, meaning that 43% of such issues need to be tested for manually or though tools like axe extensions Intelligent guided tests.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ungroomed Ticket needs a maintainer to prioritize and label
Projects
None yet
Development

No branches or pull requests

2 participants