This is an archived snapshot of W3C's public bugzilla bug tracker, decommissioned in April 2019. Please see the home page for more details.

Bug 26869 - alt text length
Summary: alt text length
Status: RESOLVED MOVED
Alias: None
Product: HTML WG
Classification: Unclassified
Component: LC1 alt techniques (editor: Steven Faulkner) (show other bugs)
Version: unspecified
Hardware: PC Linux
: P3 normal
Target Milestone: ---
Assignee: Liam R E Quin
QA Contact: HTML WG Bugzilla archive list
URL:
Whiteboard:
Keywords: a11ytf
Depends on:
Blocks:
 
Reported: 2014-09-20 00:09 UTC by Liam R E Quin
Modified: 2016-02-23 11:35 UTC (History)
6 users (show)

See Also:


Attachments

Description Liam R E Quin 2014-09-20 00:09:08 UTC
Add a note to make clear that ALT text may be truncated (at least visually) in the area that would be left by the image, had it been displayed, so that one cannoy rely on more than a few words being presented for the use cases of sighted people who are not loading images, or where images are unavailable.
Comment 2 steve faulkner 2014-10-15 09:26:32 UTC
the current text about alt text length which was agreed on 4 months ago:


"How long should a text alternative be?

A text alternative for an image should be as long as it needs to be to adequately convey the information in the image, in the context the image is being used.
How long should an alt text be?

While there are no definitive right or wrong lengths for text alternatives provided using the img element's alt attribute, the general consensus is that if the text alternative is longer 30-50 words (2 to 3 sentences), it should not be considered a short text alternative and should not be presented using the alt attribute. Refer to the section - Graphical Representations: Charts, diagrams, graphs, maps, illustrations for example methods of providing longer text alternatives for images.
Note

A text alternative provided using the alt attribute is exposed to screen reader users as a text string, generally announced as a chunk, and cannot be structured into paragraphs or have other markup added to aid comprehension."
http://w3c.github.io/alt-techniques/#m5

How does the additional complication of this advice around the issue of alt text display in browsers help a developer to write good alt text?
Comment 3 steve faulkner 2014-10-15 09:37:33 UTC
Should we, for example, be advising developers to modify the alt text length in the image in the test page http://codepen.io/stevef/debug/sJAKy because some browsers do not either display the text or truncate the text when images are disabled or the src is incorrect?

code:

<img src="http://www.html5accessibility.com/images/cross.png" alt="not supported" height="16" width="16">
Comment 4 steve faulkner 2014-10-15 12:32:25 UTC
filed another bug on chrome https://code.google.com/p/chromium/issues/detail?id=423725&thanks=423725&ts=1413376182
Comment 6 Liam R E Quin 2014-10-15 17:48:56 UTC
My own feeling, coming to the document from the outside, is that a best practice document should explain that alt text might be truncated by browsers, or even dropped entirely, if the text doesn't fit in the space available for the image, so that authors should not rely on it being presented in full for all users when images are for any reason not rendered.

The HTML 5 spec doesn't seem to say clearly exactly what a browser should do, unfortunately, so it's not clear that any of the browsers are actually buggy, although since not displaying the attribute content at all is pretty unhelpful I agree it's worth filing a bug.

What do screen readers do in these cases?

I had added width and height attributes to a copy of one of the examples in the draft and found firefox wraps the alt text, which is useful, and fits it all for that particular example, but as you point out Chrome doesn't even try. (I'm not able to try IE right now). Actually Firefox's behaviour depends on the DOCTYPE, so probably standards mode vs. quirks mode.
Comment 7 Shane McCarron 2015-01-29 17:29:43 UTC
Moved into LC1 component as per discussion in HTML A11Y Task Force on 29 January 2015
Comment 8 Charles McCathieNevile 2016-02-23 11:35:15 UTC
We believe that Liam will propose changes to HTML at some point, based on the work on the "alt text guidance" in the HTML a11y TF