Requiring the alt Attribute in HTML5

I asked on Twitter and on Juicy Studio for opinions about whether or not the alt attribute should be required in HTML 5 on the img element for conformance and the reasons why. The following is a summary of the responses for and against requiring the alt attribute.

Reasons why the alt Attribute Should Be Required

Reasons why the alt Attribute Should Not Be Required

Repair Techniques

When alt text has not been provided by the author and it is not possible to generate meaningful meta data about the image, the authoring tool should not generate default alt text, as that is likely to result in poor quality alt text; the number one reason given by those who responded that alt text should not be required. When alt text has not been provided, and it is not possible for the authoring tool to generate any kind of repair, such as meta data, the alt attribute should be omitted. The resulting output, however, should be considered invalid, as it is not structurally complete.

It is unreasonable to state that the output from authoring tools should always be considered valid, regardless of input from the user. Considering output to be correct regardless of input is at odds with the general garbage in garbage out (GIGO) principle. For example, an author can provide an address with the address element that isn't a contact address, which would not be considered compliant. The author obviously has a responsibility in using an authoring tool.

HTML5 the Markup Language

A markup language should be concerned about structure. The img element is not complete without an alternative, as it will not be perceivable by some people. The simplest and easiest way to ensure the img element is structurally complete is to provide an alt attribute in accordance with guidance provided by WCAG 2.0. If the alt attribute is not provided, there should be a way of ensuring an accessible alternative is provided.

Alternatives to the alt Attribute

One of the suggestions against the alt attribute being required is that WAI-ARIA's aria-labelledby could be provided instead. WAI-ARIA's aria-labelledby attribute could provide an accessible alternative, but only when the natural concise text alternative is available elsewhere on the page, such as in the image's description. Most of the time, this is unlikely to be the case — for example, when images are used as navigation items. However, there are examples where aria-labelledby could be considered an accessible alternative for an image.

Another alternative that could be conveyed from an accessibility architecture to assistive technology is the legend element used with the figure element in HTML5.

Requiring an Accessible Alternative

A text alternative for non-text objects ensures the content is structurally complete and accessible. For the img element, the accessible alternative can be provided by any of the following.

It is preferable that the accessible alternative always be provided by the alt attribute, as the value can be suppressed (with alt="") when it clashes with other sources for an alternative, such as the legend element. If it is decided that the alt attribute should not be required for conformance, then it is recommended that it be mandatory to provide an accessible alternative through one of the preceding three methods and that any one the three methods be required for conformance.

As the img element is structurally incomplete without a text alternative, HTML5 should make it mandatory for an accessible alternative to be provided; either by making the alt attribute required, or by providing the aria-labelledby attribute or the legend element with the figure element when the alt attribute has not been provided.