Ignores "alt" text on <object> element
See original GitHub issueProvide the steps to reproduce
- Run LH on https://pwa.cafe
What is the current behavior?
It fails, saying that <object> elements do not have [alt] text
, put prints the failing element showing that it does indeed have an alt
attribute with text.
https://twitter.com/lukeed05/status/1046462007841447936
Second Picture
What is the expected behavior?
It should be able to parse the alt
text correctly since it exists.
Environment Information
- Affected Channels: Chrome Extension
- Lighthouse version: 3.2.0
- Node.js version: N/A
- Operating System: OSX
Issue Analytics
- State:
- Created 5 years ago
- Comments:9 (4 by maintainers)
Top Results From Across the Web
<object> elements must have alternate text | Axe Rules
Add alternative text to all embedded <object> elements using either inner text, title attributes, aria-label or aria-labelledby . The object-alt rule has six ......
Read more >Decorative Images | Web Accessibility Initiative (WAI) - W3C
In these cases, a null (empty) alt text should be provided ( alt="" ) so that they can be ignored by assistive technologies,...
Read more >Chrome won't render alt content for <object> when the data ...
Disabling Chrome's PDF viewer from chrome://plugins allows the alt text to be rendered, but alas now we can't see the PDFs. <object type=" ......
Read more >The Hidden Nuggets of WCAG2: When Not to Use ALT Attributes
These devs take this to mean that an ALT attribute may be omitted where the element effectively has no meaning. In fact, WCAG2...
Read more >Video: Improve accessibility with alt text - Microsoft Support
Alt text can be read by screen readers, and helps people who are blind or who have low vision understand what images and...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I’m not an expert on the
object
element (as you note it’s rarely used these days 😉), but the linked axe docs from Lighthouse have this to say…It seems like screen readers expect alt text somewhere other than the
alt
attribute for theobject
element. If you think this is wrong, feel free to file an issue over in axe-core. We’ll pickup anything they change in the next version 😃not totally sure what you mean. afaik you have a few options with this svg
<img src="file.svg">
<img src="data:base64encodedsvg">
<object data=file.svg>
the and <object> options all require an alt attribute.
Personally I feel like inline SVG is the right semantic call here. it carries with it some other accessibility responsibilities (these probably?), but you’re luckily in that axe-core currently doesn’t inspect SVG, so it won’t be flagging things… for now. 😃