As of March 2013, longdesc attribute (@longdesc) has been reinstated in HTML5 as an extension specification, and is now available as a first public working draft (FPWD). This means that @longdesc is now “legal” in the sense that it is part of HTML and is no longer a deprecated attribute. @longdesc is supported by some major browsers and by at least two screen readers, JAWS and NVDA.
The longdesc attribute uses a URL to point to an off-page description (a code example would be <img src=”foodchain.jpg alt=”A depiction of the food chain.” longdesc=”foodchain_description.html” />. Assistive technology that recognizes the longdesc attribute will notify the user that the description is available (e.g., a screen reader will read the image’s alt and then announce “Has long description” or “Press ‘enter’ to hear long description”) and the user can choose to hear the description or not. Browsers do not currently make it visually obvious that @longdesc is available on images, so its discovery is currently limited to assistive technology.
There are other ways to link images to long descriptions; among them is using the aria-describedby property, which will associate an image with a description but only on the same page. Both aria-describedby and @longdesc are legitimate methods to convey long image descriptions, so how to decide which is the best one to use? The good news is that you can use either or both. If you are producing HTML5 or EPUB3 documents, here are DIAGRAM’s recommendations to help you decide what to do.
- If the image and description appear on the same page, use aria-describedby. See example code in the EPUB3 Accessibility guidelines.
- If it is not practical to put the description on the same page as the image, use @longdesc. You can see an example here.
In EPUB3, @longdesc may eventually be replaced by a new attribute or property (possibly @epub:describedAt) that will associate images with off-page descriptions, but this has yet to be determined. ARIA may also eventually contain a similar property called aria-describedat (see the unofficial draft) but, as with EPUB3, this is not yet definite. For the time being, it is safe to use either of the two methods described above when conveying long image descriptions to users.