From HTML WG Wiki
Designating the role of embedded content
Corresponds to issue number 46
Problem statement / use cases
- Authors sometimes omit alt text to indicate the embedded content is decorative, but other times it is omitted just to circumvent conformance checkers
- Authors have a need to differentiate between decorative images requiring no alternative text equivalent at all and photographs and similar graphics where alternate text may be unnecessary for users to comprehend the document, but the presence of such photographs is still important
- Authors sometimes omit the alt attribute entirely due to inadequate understanding of conformance requirements or at other times to force AT to read the filename of an embedded content file
- Users unable to consume embedded content might want to understand the role of the embedded content to either decide whether to read text equivalents located other than in the alt attribute value or to understand if the page will be accessible to them at all.
The following proposals seek to address these use cases. First by differentiating different types of text description that might serve as an equivalent to a piece of embedded content. Second, by making use of the 'role' attribute, introducing four new NCNames for the role attribute. Third requiring exactly one of these keywords be included on every embedded content element. And finally, requiring text equivalent fallback accompany embedded content elements for only two of those keywords: 'icon' and 'meaningful'.
So this proposal involves a three-pronged approach to ensuring the accessibility of non-text media:
- the role attribute indicates the type of role occupied by the non-text media within the document
- the alt attribute for the IMG element or the final fallback contents of the OBJECT element provides crucial text alternates for graphics in accordance with the accepted practices of the alt attribute (and determined by the role attribute’s values)
- relying on the presence of subject descriptions for photographs and similar media made available either through reference via the longdesc or aria-describedby attributes or by directly accessing the UANormAndDOMForMediaPropeties: photographs metadata properties
Distinguish between equivalent description
- Iconic description: For example, if an icon is used to mark a "comment" or "for further investigation" or to indicate the purpose of a graphical hyperlink, the text equivalent should focus on the iconic role for the embedded content.
- Subject description: A subject description focuses on the subject of the embedded content, largely independent of its visual or aural qualities. For example, a description of "The South face of Mount Everest", "A portrait of Grouch Marx", or "A song about always looking on the bight side of life".
- Visual/aural description: Visual and aural descriptions often invoke the subject of the content, however, they focus more on the visual and aural qualities of that content. A visual description may focus on the colors, the contrast and the detailed visual subjects of an image or video. A visual description for video may focus on the action taking place. Is it fast-paced, jerky handheld camera motion? Is it a still and quiet video? Aural description may focus on the detailed audible subjects of audio content. For example, crickets;in the background. It may focus on the melody, harmony and instrumentation of audible music in the audio content.
- Hybrid description: Many descriptions are necessarily hybrid in nature. For hybrid descriptions authors should ensure the iconic portion occurs at the beginning of the description and even includes explicit markup to mark the iconic portion of the description. Other description may include both the broad subject description of the content and also detailed description of the many intricate pieces of the content. It may also include visual details of the detailed subjects of the content. For example describing the multiple colors of the pedals in each flower in avase in the background of a photograph of a hotel room in a travel oriented HTML document. The important rule to follow in hybrid descriptions is to include iconic descriptions first, followed by subject descriptions that focus on the broad themes of the content — especially as it relates to the present document in which its embedded. Finally, if the text equivalent includes more detailed visual and aural description that text should come last in the text equivalent.
Note that for text equivalents provided in the 'alt' attribute, authors should generally avoid hybrid descriptions, instead focussing only on iconic descriptions for 'icon' embedded content and brief subject descriptions for 'meaningful' embedded content. More elaborate subject descriptions, visual, and aural descriptions authors should use the longdesc attribute to reference a document fragment either in the current document or another document. Generally longdesc attribute URLs should include the fragment identifier hash ("#") to point to a specific part of a document containing the long description.
Require role attribute
Propose requiring the role attribute on all embedded content elements with one of the following keywords:
- meaningful (m)
- illustrative (ilstr)
- decorative (d)
The string in parentheses indicates a short form meaning the same thing.
In addition, authors and authoring tools may add and remove the following keyword to track the sate of the fallback:
Require fallback depending on role attribute value
- meaningful (text alternate required; generally a subject description of the content)
- icon (text alternate required; generally an iconic description of the content)
- illustrative (since the content is an illustration of the existing ext exposition, the text equivalent optional; primarily for visual description)
- decorative (text alternate optional; primarily for visual description, though some subject description may also be useful)
- <missing all of these> (may be a pre-HTML5 document; embedded role and alternate content, if any, is indeterminate)
|role↓||type of text equivalent||Note|
|icon||R||O||O||iconic text equivalents are perhaps the most important. Omitting an iconic text equivalent will make the page virtually unusable for those unable to consume the content. In such cases the selection of an icons is largely secondary to the meaning of the element — interactive of otherwise — it is designed to mark. Such icons could also be deployed using CSS image replacements for the semantic marker (such as a class attribute value) within the HTML markup.|
|meaningful||R||O||Meaningful embedded content requires a subject description to explain what the user cannot see or hear due to the inability to consume the embedded content file directly. Such a subject description might be derived from the file's own metadata title, keywords and description, however, it might also require author's taylor the subject description to the current document’s context.|
|illustrative||O||O||For illustrative images, the description of the meaning is already contained in the surrounding prose. The illustration simply reiterates or underscores the meaning of the surrounding prose|
|decorative||O||O||Decorative embedded content is usually better handled through CSS. However, if it is included within the HTML markup, it is necessary to indicate it as decorative. Both subject and visual/aural descriptions of the embedded content might be tangentially related to the meaning of the document, but omitting those text equivalent should not create any barrier to the users understanding.|
Add a new embedRole DOM attribute
- undefined (no role attribute or a role attribute but without any of the embedded content keywords)
- missing (a role attribute with at least one of the embedded content keywords, but no alt attribute)
- meaningful (a role attribute containing the keyword 'meaningful')
- meaningfulIcon (a role attribute containing both the keyword 'meaningful' and the keyword 'icon')
- illustrative (a role attribute containing the keyword 'illustrative' but not containing the keyword 'meaningful' nor the keyword 'icon')
- icon (a role attribute containing the keyword 'icon' but not containing the keyword 'meaningful')
- decorative (a role attribute containing the keyword 'decorative' but not containing the keywords 'meaningful', 'illustrative' or 'icon')
Document authoring norms
Authors would be required to include the role attribute and at lease one of the four embedded content keywords on all embedded content elements. For the keywords 'icon' or 'meaningful' the author would also be required to including an iconic description or a subject description respectively. Authors MUST NOT indicate an inadequate text equivalent simply to circumvent the conformance checker. However, conformance checkers should include a session-scoped option for authors to suppress the errors related to these embedded content requirements. By session-scoped this means that the option to suppress such errors must not be persistent beyond the current session (as defined by the conformance checker UA) for the same document. If the author switches to another document or checks the same document with a new session, the flag to suppress errors should be reset and the conformance checker must again show all embedded content equivalent related document errors.
Norms for editing and conversion UAs
- Must not add role unless through author intervention.
- Must not add an alt attribute unless through author intervention.
- Editing UAs that deal with media of only one of these roles MAY allow authors to determine this through a persistent preference or setting (e.g., a photo editing application that produces HTML content might deal only with 'meaningful' media).
- Editing and conversion UAs may prompts a user to designate a role for images in batch mode, but should warn the author of the possibility for error.
Norms for conformance checking UAs
- Conformance checkers may provide an option for authors to suppress embedded content warnings related to missing role keywords, and missing text equivalents, however, such optional suppression MUST NOT persist from one document to another or from one session to another (a session as implemented by the conformance checker).
missingfallback as explicit keyword
- provides a clear delineation that the author has omitted the fallback
- The existence of this keyword can become out of sync with the actual setting of the fallback
missingfallback as implied keyword
Discussion and evaluation
- Provides a better mechanism to convey the role of embedded content than simply an empty string or no alt attribute
- Works with any embedded content element, not just the IMG and IFRAME elements.
- Provides significant information to AT users and other UA users who cannot consume embedded content with a minimum effort by authors (many cases require nothing more than selecting among four keywords).
- Provides a clearer taxonomy of text equivalents in iconic description, subject description and visual/aural description.
- Requires authors to make substantive changes — requiring author intervention — for each embedded content element to migrate from an HTML 4.01 or XHTML conforming document to and HTML5 conforming document.
- Description of user testing an the desire of users to know the type of image or non-text media encountered before deciding to pursue a text alternative (Debi Orton)
- Issue-tracker: Issue 46
- UA Norm and DOM for media metadata properties
- A mechanism for alternate content within HTML documents
- Issue-tracker: Issue 31 — should missing alt be conforming?