img element in the current HTML 5 draft doesn't include the
longdesc attribute, and the
alt attribute will no longer be a required attribute.
Author: Gez Lemon
One of the great things about the current HTML 5 draft is that they give plenty of examples of how to specify alternate text for images, although a few of them are misguided. Alternate text should be concise, and a longer description provided with a
longdesc attribute if necessary. The incomplete techniques document for the current WCAG 2.0 draft contains the following advice for specifying alternate text on images:
When using the
imgelement, specify a short text alternative with the
altattribute. Note. The value of this attribute is referred to as "alt text".
When an image contains words that are important to understanding the content, the alt text should include those words. This will allow the alt text to play the same function on the page as the image. Note that it does not necessarily describe the visual characteristics of the image itself but must convey the same meaning as the image. If the text in the image is more than can fit in a short text alternative then it should be described in the short text alternative and a
longdescshould be provided as well with the complete text.
As the current specification for the
img element in HTML 5 doesn't include a
longdesc attribute, the alternate text in their very first example is too verbose at 43 words (216 characters). The example would be better if the image was described more succinctly, and the extra information included in the main body text; if text in the main body is undesirable, because it's duplicating the content in the image, for example, then a better technique would be to specify a URI to a longer description using the
longdesc attribute. If the final HTML 5 specification doesn't include a
longdesc attribute, then authors of accessible material will have to resort to the infamous D-link, deprecated in WCAG 1.0 techniques in favour of the
longdesc attribute's value is a URI, the resulting page containing the longer description can be marked up with rich structural elements (lists, tables, and so on) to aid understanding, which isn't possible with plain text in an image's
alt attribute. The
longdesc attribute is useful for creating accessible content without having to resort to D-links, which can detract from the design of a page.
Another contentious issue with the current HTML 5 draft is that the
alt attribute for an image may be omitted completely. The reasoning is along the lines that there are examples of applications where users don't know how to provide alternate text, such as Flickr, and it has been observed that systems make up for this by generating alternate text from the image's meta data. The perceived benefit of not providing alternate text supposedly makes it easier to distinguish between images that have no alternate text, or are part of the critical content. From an article by Lachlan Hunt about why the alt attribute may be omitted:
The benefit of requiring the
altattribute to be omitted, rather than simply requiring the empty value, is that it makes a clear distinction between an image that has no alternate text (such as an iconic or graphical representation of the surrounding text) and an image that is a critical part of the content, but for which not [sic] alt text is available.
I don't understand how a user agent is supposed to differentiate between an image with deliberately missing alternate text, or alternate text that is missing because the author didn't know how to specify alternate text. We all agree that alternate text is essential for accessibility; it's not accidental that the very first requirement from any set of accessibility guidelines is that alternate text is provided for non-text objects.
Providing blank alternate text is something that must be done deliberately, and helps user agents determine whether or not the alternate text is in need of repair, as opposed to just omitting the attribute; of course, there will be scenarios whereby assistive technology will rely on heuristics when alternate text is missing, regardless of the markup - for example, when an image alone is used as the link phrase in an anchor element or part of an image map and empty alternate text is provided. In this case, assistive technology has to present something to the user so that they know what the link is, so will attempt to get the information elsewhere; such as from the title attribute, or in extreme cases, from the
src attribute of the image. At least specifying null text for the
alt attribute is a definite decision on the part of the author, and not the ambiguous situation of not knowing whether the alternate text was accidentally or intentionally omitted.
Alternate text contains important information about an image that must be included in the structure, even if that information is blank because the image is purely decorative. It is better that purely decorative images are not included in the structure in the first place, but included with CSS. However, there should also be a markup solution to indicate whether or not the alternate text of an image is critical to understand the content - omitting such an important attribute is ambiguous, and doesn't help anyone. Systems that generate poor quality alternate text need fixing, and all authors should be encouraged to provide high quality alternate text.
- Why the Alt Attribute May Be Omitted
- Investigating the proposed alt attribute recommendations in HTML 5