This Wiki page is edited by participants of the HTML Accessibility Task Force. It does not necessarily represent consensus and it may have incorrect information or information that is not supported by other Task Force participants, WAI, or W3C. It may also have some very useful information.

Bugs/img Guidance for Conformance Checkers

From HTML accessibility task force Wiki
Jump to: navigation, search


This bug has been superseded.

For the latest description of Bug 8716 please visit Change Proposal: Replace img guidance for conformance checkers, as the HTML Chairs have called for HTML Issue 31 Change Proposals. - Thanks, Laura.

HTML5 Change Proposal: Replace img Guidance for Conformance Checkers

Editor: Laura Carlson (laura.lee.carlson@gmail.com)

Date: January 26, 2010.

For HTML ISSUE-31: missing-alt

Summary

This change proposal modifies the HTML5 Specification so that automatic validators can programmatically detect the presence or absence of text alternatives on the img element. It replaces the current conformance checkers guidance [1] with clear guidance that lists all required short text alternative options that exist in order for <img> to be considered valid. It requires any page that lacks a text alternative for an image by at least one of the machine testable options to have the validator flag an error and declare the page invalid.

The current guidance for conformance checkers is unclear and does not implement the Web Initiative Accessibility Coordination Group's (WAI CG) [2] advice on the validation of short text alternatives [3]. This change proposal helps resolve HTML ISSUE-31: missing-alt [4].

Issue 31 is a big issue. The point of the change proposal is to address the whole problem comprehensively. The missing alt Issue is:

"What to do when a reasonable text equivalent is unknown/unavailable?"

A WAI CG Task Force studied the matter comprehensively for several months last year and came up with a holistic solution. It contains a number of pieces that need to work together. They are incorporated into this proposal.

Rationale

Structural Integrity of the Language

Requiring a set of programmatically valid options helps ensure that images have complete structure. Complete structure requires both src and text alternatives.

src is to sighted users as text alternatives is to some users with disabilities.

  • Omit the src attribute and sighted users have no content.
  • Omit text alternatives and some users with disabilities have no content.

Without both a src and a text alternative the <img> element is incomplete.

Accessibility Awareness

Enabling automatic validators to programmatically detect the presence or absence of text alternatives (like HTML4 did with alt) raises public awareness of Web accessibility in general. It is an undeniable advertisement that text alternatives are needed and a chance to educate the author about proper usage. It has been said that the W3C HTML4 validator has done worlds more than the HTML4 specification for increasing the quality of HTML documents on the web. [5]

Education - A Teachable Moment

Requiring a set of programmatically valid options aids in accessibility education [6]. When the validator flags missing text alternatives it creates a teachable moment. A moment of great opportunity: a time to flag errors, educate, to make people aware, and to get action, to get people to actually fix their pages. The W3C validator is currently used as a web accessibility teaching tool. Students are instructed to use the W3C validator in classes in order to flag missing text alternatives. It is the very first step in getting that important message across. One of their first lessons is to validate HTML on the W3C site to be sure that it is error-free and that they have indeed examined each image. It makes a BIG impression that text alternatives are mandatory not just for WCAG but as well for valid HTML.

Doing the Right Thing

Enabling automatic validators to programmatically detect the presence or absence of text alternatives encourages authors to do the right thing.

As Ian Hickson has said, "we _should_ be calling authors out on this kind of mistake. Just because people do something doesn't mean we should make it valid - after all, we made <font> invalid, along with many other things. Conformance is about trying to advise authors to do the right thing." [7]

Addressing Business Needs

It is possible to require a set of programmatically valid options which maintains the integrity of the markup and aids accessibility while addressing business needs. A "generated" and "missing" attribute could address the business concern of authoring tools wanting to conform to HTML5 even if the author does not supply a text alternative. The outcome would be practical methods of detection, repair, and handling.

WAI CG said that they would not oppose creating a "generated" or a "missing" attribute. It is optional if these two attributes are created or not.

generated Attribute

Creating a generated attribute [8] to indicate that a metadata repair technique is being used would allow users of image galleries time to provide text alternatives. As proposed by Jan Richards [9] it provides a practical method of detection and handling in harmony with Authoring Tool Accessibility Guideline (ATAG) 2.0 B.2.4 . [10]

Since WAI CG condones a Flickr loophole at the element level, a generated mechanism should only be included at the element level as a generated attribute, rather than the document level. If the generated option is left at document level (as in the current editor's draft) it would be too easy for authors just to tag the document "generated" and not bother with any alternative for images.

missing Attribute

Creating a attribute] [11], as WAI CG said they wouldn't object to, allows "images whose contents are not known" to be labeled as such. It would enable tools to quickly discern where text alternatives are needed and would allow for future improvement. Possibilities for crowdsourcing exist with the addition of a "missing" attribute. [12]

Added Options which Address Accessibility

role="presentation" Attribute

role="presentation" programmatically conveys to assistive technology that an image is presentational and not of interest.

aria-labelledby Attribute

When the natural concise text alternative is available elsewhere on a page the aria-labelledby attribute can be an accessible alternative for an image as it programmatically conveys meaning to assistive technology. For example:

<h2 id="bronze">Bronze Medal</h2>
<!-- Some page content -->
<img src="bronzemedal.png" aria-labelledby="bronze">

Email Exceptions are Beyond Our Scope

The Private communication email exceptions in the current editor's draft are beyond the scope of both HTML5 and WCAG 2.0 and should be addressed at a policy level rather than the specification level. This rule digresses too far into business-process issues.

This email exceptions rule makes assumptions about the lifetime of messages and takes a static approach to disability. Emails get forwarded and the degree of disability may vary over time. The intended recipient isn't always the actual recipient. The intended recipient may well be able to view images, but rendering them on a device unable to render images or have images switched off to save on downloads.

title Attribute Is Not An Acceptable Text Alternative

The title attribute is not an acceptable text alternative as it's content is not displayed to the user unless they can use a mouse and beforehand know the content is there. The content of the image title attribute is also often not detected by AT by default unless the user makes an explicit choice in their preferences to announce the attribute contents.

Authors are advised to only use the title attribute for "additional information" and not as a full equivalent alternative. Removing title would make the HTML specification in line with WCAG, and previous authoring practices. [13]


Details

Replace the Current Text:

A conformance checker must report the lack of an alt attribute as an error unless one of the conditions listed below applies:

  • The title attribute is present and has a non-empty value (as described above).
  • The img element is in a figure element that contains a figcaption element that contains content other than inter-element whitespace (as described above).
  • The img element is part of the only paragraph directly in its section, and is the only img element without an alt attribute in its section, and its section has an associated heading (as described above).
  • The conformance checker has been configured to assume that the document is an e-mail or document intended for a specific person who is known to be able to view images.
  • The document has a meta element with a name attribute whose value is an ASCII case-insensitive match for the string "generator". (This case does not represent a case where the document is conforming, only that the generator could not determine appropriate alternative text — validators are required to not show an error in this case to discourage markup generators from including bogus alternative text purely in an attempt to silence validators.)

With Suggested Text:

"A conformance checker must report the lack of a text alternative as an error. The img element is only valid when at least one of the following is true:

  • alt is present (empty or non-empty) OR
  • @aria-labelledby is present (non-empty only) OR
  • the <img> is located within a <figure> that has a non-empty <figcaption> OR
  • @role="presentation" OR
  • <img> has an attribute other than alt whose value is an ASCII case-insensitive match for the string "generator" OR
  • <img> has a "missing" attribute.

Impact

  • Lists out validity options.
  • Changes "alt attribute" to "text alternatives" in the first sentence.
  • Declares resulting structure invalid, if one of the listed options is not determined.
  • Enables automatic validators to programmatically detect occurrences of the presence or absence of text alternatives.
  • Upholds the structural integrity of the markup language.
  • Changes the "generator" option from document level to element level.
  • Removes the email loophole.
  • Removes title attribute as an option.
  • Adds a "missing" attribute/Removes the "images whose contents are not known" loopholes.
  • Adds role="presentation".
  • Adds aria-labelledby.

Conformance Classes Changes

Optional: Create an attribute that allows a "generator" string and create a "missing" attribute per WAI CG advice, which states:

"Recommendations regarding auto-generated alternative text

We have reached the following consensus concerning "automatically generated" alternative text: In order to address both the validity and human generation concerns, we do not oppose the creation of 'autogenerated' and 'missing' attributes where either one of these could be used to make an image that does not have any human-generated text alternatives valid. (Note: It is important that this marker is not included in the alternative text string itself.)"

References

Detailed Three Year History of the Issue

A detailed three year history of the issue includes issue description, time line, proposed solutions, rationale - pros and cons, research, advice from WAI, use cases, policies/guidelines/law, and email threads:

Related Bugs