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

SVGs failing due to lack of alt attribute #2425

Open
adrianblynch opened this issue Jun 2, 2017 · 8 comments
Open

SVGs failing due to lack of alt attribute #2425

adrianblynch opened this issue Jun 2, 2017 · 8 comments

Comments

@adrianblynch
Copy link

My report suggests that SVGs should contain an alt attribute but the recommended way to do this is with a title and/or desc element.

Adding either an alt attribute or a title element to SVGs being audited still results in a failure:
screen shot 2017-06-02 at 22 32 51

Adding title elements similarly fails:
screen shot 2017-06-02 at 22 33 44

Adding both results in the same failure.

So the question is, what will it take to make this pass in Lighthouse and should the recommendation documentation be updated to reflect this?

https://developers.google.com/web/tools/lighthouse/audits/alt-attribute

@patrickhulce
Copy link
Collaborator

Thanks for the report @adrianblynch! Right now the support in axe, which is what powers our accessibility audits, seems to be a little iffy for SVG (see dequelabs/axe-core#20). You might want to chime in that thread with the issues you're seeing since they're looking for helpful examples! :)

cc: @kaycebasques for potentially updating the docs to mention pending SVG support?

@kaycebasques
Copy link
Contributor

@adrianblynch what's the source for "the recommended way to do this is with a title and/or desc element"?

@paulirish
Copy link
Member

@adrianblynch you said " the recommended way to do this is with a title and/or desc element."

can you show that these are preferred over an alt attribute?

@patrickhulce
Copy link
Collaborator

Currently waiting on axe support for this.

@mgifford
Copy link

mgifford commented Nov 6, 2018

This still seems to be an issue. Rather frustrating, particularly for things like social media icons which which should have titles baked into them.

@adrianblynch
Copy link
Author

@adrianblynch what's the source for "the recommended way to do this is with a title and/or desc element"?

Sorry @kaycebasques and @paulirish - It's so long ago I can't remember where I read this.

@Malvoz
Copy link
Contributor

Malvoz commented Feb 10, 2020

The svg-img-alt rule landed in dequelabs/axe-core#1953. 🎉

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

No branches or pull requests

8 participants