In the comments from my most recent article, “Supporting Standards that Support Accessibility,” a number of interesting thoughts were raised concerning the requirement (or lack thereof) of the
alt attribute in HTML (HyperText Markup Language) 5.
It’s a difficult issue.
I’ve seen numerous articles around the web which discuss the fact that HTML 5 does not require the
alt attribute. To some degree, this is true: HTML 5 provides exclusions to the requirement. In situations where an image is significant but no alternative text can be provided, HTML 5 recommends that the
alt attribute be left off as an indicator that the image is significant (not a purely decorational image).
It’s actually quite a bit more complicated than that — the specification describes detailed guidelines for when the
alt attribute should be left off, when it should be given a value, and when it should be provided without a value.
My complaint, and the complaint of many others involved in the web standards world is against the concept of providing any reason that the
alt attribute may be left off. Ian Hickson states:
Empty alt text means the image is unimportant (decorative) and should be ignored. Missing alt text means that the image is important, critical even, but that there is no fallback text provided. The user agent is expected to treat the two cases differently.
At least, thatâ€™s what the HTML5 spec says at the moment.
I believe that it is important to provide a way to distinguish the two cases above; putting both of them into the empty alt=â€?” category would be, IMHO, bad for the accessibility of the aforementioned pages.
He’s right, of course — it is quite important to distinguish between insignificant images such as decorational graphics and between significant but undescribed or undescribable images. The challenge, then, is to come up with a solution to the problem which allows the
alt attribute to remain.
So…what are some possible alternatives?
The first thing that comes to mind is to add a signifier attribute. Something which indicates whether an image is significant or non-significant. This would require some revision to HTML generating tools, but certainly no greater a change than that expected for new elements. It would be best to assume a default value when the element is not provided which assumes the image is significant, for backwards compatibility.
A second possibility would be to introduce a key term available to the
alt attribute which would indicate significance. This strikes me as a bad idea, since it would have relatively poor backwards compatibility, and would require selecting a term which would become unavailable as normal
alt text. Nah, that’s not really going to work.
Third…I’m struggling to come up with another idea…
I’m very open to any thoughts on the subject. Problems with these ideas are welcome, as are suggestions of any off-the-wall idea you may have!