dequelabs / axe-core

Accessibility engine for automated Web UI testing
https://www.deque.com/axe/
Mozilla Public License 2.0
5.75k stars 746 forks source link

Lighthouse flags 1x1 tracking pixels under the 'image elements do not have [alt] attribute' #4513

Closed omriariav closed 3 days ago

omriariav commented 4 days ago

Product

axe-core

Product Version

No response

Latest Version

Issue Description

Expectation

I think the lighthouse accessibility audit should ignore tracking pixels (usually 1x1 image sizes) as they mean nothing to the end users (although that I am not an accessibility expert)

Actual

We see the tracking pixels flagged in Lighthouse under the 'image elements do not have [alt] attribute'

How to Reproduce

https://pagespeed.web.dev/analysis/https-www-khaleejtimes-com/e08ds96fqe?form_factor=desktop Screenshot 2024-06-10 at 6 13 09 PM taboola

Additional context

As a third-party library (Taboola), we fire those tracking pixels on behalf of our advertisers. We are responsible for not downgrading LH scores, including this example.

dylanb commented 3 days ago

just put alt="" on all your tracking pixels

omriariav commented 3 days ago

Many third-party vendors or website owners curate these tracking pixels. I think the Lighthouse team needs to work with those vendors so that they will share the tags with the attribute. We, Taboola, can sustain the overhead of checking in our systems if this attribute is missing and then adding it on our own, but I think this is something we need to let all tracking pixels vendors be aware of.

Other than that, I don't understand how putting an empty alt on 1x1 pixels serves our esteem goal of improving accessibility, so it's worth rethinking this.

dylanb commented 3 days ago

It does the correct thing - it tells the user that the image has no semantic value and thereby also eliminates assistive technologies from reading out a bunch of file names to screen reader users

omriariav commented 3 days ago

@dylanb you are right. I appreciate the time you took to reply/explain.