question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Ignores "alt" text on <object> element

See original GitHub issue

Provide the steps to reproduce

  1. 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:closed
  • Created 5 years ago
  • Comments:9 (4 by maintainers)

github_iconTop GitHub Comments

2reactions
patrickhulcecommented, Oct 1, 2018

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…

Add alternative text to all embedded object elements using either inner text, title attributes, aria-label or aria-labelledby.

It seems like screen readers expect alt text somewhere other than the alt attribute for the object 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 😃

1reaction
paulirishcommented, Oct 1, 2018

I’m a little confused if this is a valid issue or if I should move the content within the tags.

not totally sure what you mean. afaik you have a few options with this svg

  1. <img src="file.svg">
  2. <img src="data:base64encodedsvg">
  3. css background-image
  4. <object data=file.svg>
  5. inline SVG right inside the HTML

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. 😃

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found