Skip to content
This repository has been archived by the owner on Dec 7, 2022. It is now read-only.

Img alt text should be considered when evaluating label text for links #156

Closed
kloots opened this issue May 28, 2015 · 5 comments
Closed

Comments

@kloots
Copy link

kloots commented May 28, 2015

The Link With Unclear Purpose check only checks for text content. This means you can get a false negative if a link's content is an image with alt text. Rather than evaluating the text content, the test should be using the getTextFromDescendantContent util method.

@jdan
Copy link
Collaborator

jdan commented Jul 8, 2015

Looks like getTextFromDescendantContent isn't picking up on alt text. Is there an alternative? Otherwise I'll be checking for alt manually.

EDIT: findTextAlternatives works for this and might be what we want!

@ckundo
Copy link
Collaborator

ckundo commented Jul 24, 2015

Looks like this was resolved in #38.

@ckundo ckundo closed this as completed Jul 24, 2015
@ckundo ckundo reopened this Jul 24, 2015
@ckundo
Copy link
Collaborator

ckundo commented Jul 24, 2015

Oops, thought this was resolved but it was actually a PR against tota11y. My mistake!

@ricksbrown
Copy link
Collaborator

This is a good point and in the same vein as #202.

I'd like to take this further - it would be quite easy to generate a link that was visually meaningful with no content at all, for example using the content CSS property.

I'll open a PR for this.

ricksbrown added a commit to ricksbrown/accessibility-developer-tools that referenced this issue Jul 29, 2015
@ricksbrown
Copy link
Collaborator

You could do the same thing with no content and a CSS background image too.

The PR I have opened allows for this (as long as there is aria-label or other text alternative). Should it?
If it's accessible to ALL users (visual, keyboard, mouse, AT, touch screen etc) then it's all good right?

Even if it's done in a strange way... I could actually imagine wanting to do this when payload size and/or DOM size were of the utmost importance.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

5 participants