You may have heard some discussion about “longdesc” recently which spiked when much debate broke out on whether to keep it in the HTML5 specification. Unless you’re a “veteran” web professional, you may not even heard of “longdesc”. So what is it, you ask, and should you be using it? Let’s examine.
What Is Longdesc?
As you probably know, the
alt attribute is intended to provide a short text-based alternative description of an image on a web page. Additionally, the
longdesc attribute was designed to point to a web page which provides a longer, detailed description of an image, when needed. It complements the image element’s alt attribute; when a description is longer than what feasibly works with
longdesc would be used. As we’ll discuss, there are other potential uses for
longdesc, but the primary reason for its use is for blind and low-vision users who are using a screen reader and cannot see a content-heavy image. Many use cases exist for a long description which include describing a logo, comic, piece of artwork, graphical chart, infographics, and photograph. (Note that
longdesc was specified to support the frame and iframe elements as well, but hardly anyone even knows that, never mind implements it!)
On the surface, the
longdesc attribute seems like a great way to provide detailed text descriptions of an image. But unfortunately the technique has never achieved its full potential, to say the very least. So much so, that many believe
longdesc should be entirely forgotten and in many resources is no longer a recommended technique.
A few years ago, an article was written which documents the extremely small percentage of images which have
longdesc implemented correctly (approximately 1 in 100,000 images; 1 in 100 who attempt it). More recently, in defense of the attribute, many examples of proper
longdesc implementations were documented (by a variety of entities such as museums, universities, personal blogs, government agencies, etcetera). However you look at it, it’s agreed that the overall process of providing an image long description is broken and something must be done.
So why is
longdesc hardly ever implemented or done incorrectly so often? One reason, like many other accessibility-related concepts and techniques, is ignorance; if web authors (designers, developers, owners) don’t understand why they should do something (provide alternative text in this case), they probably won’t do it. Another reason is lack of proper training; authors just aren’t taught how to use
Some folks declare that the name “longdesc” itself is an issue, but I don’t necessarily agree. The argument is that the name is misleading which is why many times the text description itself would mistakenly be entered in the attribute value, rather than a URI, as defined (basically, a URL). Although this error does occur often, training is still the source of this problem considerably more than the name of the attribute.
In addition, some advocates of WAI–ARIA insist that the
aria-describedby attribute takes care of the issue. But there are many arguments against this as a replacement, many outlined in an HTML5 Change Proposal. The top points are:
aria-describedbyattribute cannot point to content off the page (to a URI, as
longdescdoes); it can only point to in-page anchors (IDREF). A negative result of this is it cannot provide one common external description for the same image repeated over different pages.
- Screen readers do not pause when they encounter
aria-describedby; it is read aloud straight away like the
altattribute and forcing the longer description on the user whether they want it or not. (
longdescessentially inserts a pause where the user can choose to follow the link or not.)
aria-describedbyattribute is not backwards compatible.
Browser (Non) Support
Another reason why
longdesc is hardly ever implemented is that the major browsers do a poor job of supporting longdesc. If an author’s work won’t render in the browser, he or she is much less apt to do it. Especially if there’s a deadline approaching and there’s pressure to get the job done as quickly as possible, which is too often the case. Of today’s top browsers, only Opera 10.10+ supports it. To help other browsers along, there’s a Firefox longdesc add-on by Patrick Lauke which provides access to the long description, like Opera, through the image’s context menu. There’s also an extension for Opera, TellMeMore, by Charles McCathieNevile which provides a visual cue, as does the Firefox add-on. And I heard a rumor that an extension for Chrome is in the works.
The problem of providing image long descriptions isn’t
longdesc; it’s primarily the browsers’ failure to notify the user of the presence of the attribute.
A Case for longdesc
If browsers made
longdesc more “discoverable” data rather than “hidden”, the attribute could be much more beneficial, particularly including sighted users. Like the
alt attribute, providing long description to sighted users can be helpful when an image becomes unavailable such as in the instance of a broken image link, or in the case of low-band Internet connection (including mobile devices, let’s not forget about developing countries where mobile may be the only means of surfing the web).
And there are other uses besides visual backups. A long description can assist in comprehension of information, especially for those with cognitive impairments. Also, like audio transcripts and video captions, long textual descriptions of an image can be a means for internationalization as the text can be translated to a different language by services such as Google Translate (as opposed to text within an image which cannot be translated (not feasibly, at least not yet).
The fact of the matter is that there are many use cases for
longdesc and that there is a consensus that a mechanism to provide an image long description is needed. For now, there is no fully “functional replacement” for
longdesc. It currently works well when implemented as it’s supported by many assistive technologies including popular screen readers like JAWS and Window-Eyes.
In addition, there is a history with
longdesc; there’s something to be said about backwards-compatibility. There are many guidelines, laws, policies, and standards citing
longdesc as a solution. These appear within organizations such as IBM, the United States Postal Service, and the University of California. The
longdesc attribute has a critical support base that has taken a dozen years to build and would most likely take as much time to rebuild it with a new attribute/method for long description. Also note that
longdesc is a part of the ISO HTML (see IMG under Annex B).
longdesc image attribute is a good way to provide detailed descriptions for images that need it. But since most web authors haven’t learned about it and most browsers don’t support it, the technique is very unpopular. Other methods such as ARIA exist to achieve a similar goal but may not be fully supported either and is not a true replacement. Until browser vendors do their part, and until
longdesc is rejuvenated in the web community, there will continue to be only partially supported solutions of providing a long description of an image.
Check out Part 2, where we’ll discuss how to implement
longdesc and examine a variety of other solutions and ideas.
Dennis E. Lembree is an accomplished web developer who has worked for a variety of companies including PayPal, RIM, Ford, Google, and Walt Disney World. He is the author of Web Axe, a podcast and blog focused on web accessibility, and the author of the award-winning, web-accessible Twitter application Easy Chirp. He enjoys attending and speaking at conferences, meetups, and webinars. Outside of the tech world, he likes playing guitar, watching football, and frequenting Starbucks. Mr. Lembree is originally from southeastern Michigan and has also lived in Orlando, Florida. He now resides in Cupertino, California, with his wife and their two boys.
Jump Start Git, 2nd Edition
Visual Studio Code: End-to-End Editing and Debugging Tools for Web Developers