[whatwg] Alt attribute for <video> and <audio>

On Mon, Aug 10, 2009 at 8:53 AM, Benjamin
Hawkes-Lewis<bhawkeslewis at googlemail.com> wrote:
> On 10/08/2009 04:05, Remco wrote:
>>
>> A title is a short description, and could be the movie title in the
>> case of a video element.
>
> WCAG 2 1.1.1 requires that:
>
> "If non-text content is time-based media, then text alternatives at least
> provide descriptive identification of the non-text content."
>
> "title" and "aria-labelledby" seem sufficient for this purpose.
>
> So do "figure" and "legend":
>
> http://dev.w3.org/html5/spec/Overview.html#the-figure-element
>
>> An alt is a textual alternative for the content.
>
> [snip]
>
>> For video, audio, object, iframe, this is a little sparse.
>
> [snip]
>
>> But Elephants Dream may not be a good example for a video where an alt
>> text would be useful. It's simply too complicated to replace with
>> alternative text. But if you have a short video that explains
>> something on Wikipedia, it would be tremendously helpful if the alt
>> text would convey the same meaning. A video of a ball falling to show
>> what gravity is, could have the alt text: "A ball accelerates as it
>> moves down. Next to the ball's trajectory, a speedometer increases
>> with 9.8 m/s per second.".
>
> If you want to provide an "alternative for time-based media" (in WCAG 2's
> phrase), then you want a method that can scale to contain semantic
> information, such as indicating language changes ("lang") or changes of
> speaker ("dialog").
>
> Here's how WCAG 2 defines "alternative for time-based media":
>
> "document including correctly sequenced text descriptions of time-based
> visual and auditory information and providing a means for achieving the
> outcomes of any time-based interaction
>
> "Note: A screenplay used to create the synchronized media content would meet
> this definition only if it was corrected to accurately represent the final
> synchronized media after editing."
>
> http://www.w3.org/TR/WCAG20/#alt-time-based-mediadef
>
> Here's just three ways you could do this without changing HTML5, assuming
> the incorporation of WAI-ARIA:
>
> 1. <figure><legend>Ball acceleraton.<details>A ball accelerates as it moves
> down. Next to the ball's trajectory, a speedometer increases with 9.8 m/s
> per second.</details></legend><video>...</video></figure>
>
> 2. <video title="Ball acceleration"
> aria-describedby="alternative"...</video><p id="alternative">A ball
> accelerates as it moves down. Next to the ball's trajectory, a speedometer
> increases with 9.8 m/s per second.</p>
>
> 3. <video title="Interview with Barack Obama"
> aria-describedby="transcript-link"...</video><a href="transcript.html"
> id="transcript-link">Transcript of Interview with Barack Obama</a>
>
> See also:
>
> "WAI CG Consensus Resolutions on Text alternatives in HTML 5" (proposal for
> using "aria-describedby" in place of "longdesc"):
>
> http://www.w3.org/2009/06/Text-Alternatives-in-HTML5
>
> WCAG 2 Technique "G159: Providing an alternative for time-based media for
> video-only content":
>
> http://www.w3.org/TR/2008/NOTE-WCAG20-TECHS-20081211/G159
>
> WCAG 2 Technique G58: Placing a link to the alternative for time-based media
> immediately next to the non-text content"
>
> http://www.w3.org/TR/2008/NOTE-WCAG20-TECHS-20081211/G58.html
>
> Do these features meet your requirements? If not, why not?
>
> --
> Benjamin Hawkes-Lewis
>

A longdesc is not the same as an alt, in that a longdesc is a long
description of the content, while an alt is alternative actual
content. This distinction may in practice be unnecessary though. And I
see that the WAI has redefined alt to mean a short description. Does
this mean that the alt attribute and longdesc attribute for images can
be combined and deprecated in favor of aria-describedby or a
figure/legend combo? It would make the HTML spec more consistent.

So instead of this:

<img title="Tank Man"
alt="A man stands in front of a column of three tanks."
longdesc="page-about-tank-man-photo.html"
src="tankman.jpg">

We would get this:

<img title="Tank Man"
aria-describedby="tank-desc"
src="tankman.jpg">
<p id="tank-desc">A man stands in front of a column of three tanks. <a
href="page-about-tank-man-photo.html">More information</a>.</p>

Or this:

<figure>
<legend>Tank Man</legend>
<img src="tankman.jpg">
<details><legend>Alternative content</legend>A man stands in front of
a column of three tanks. <a href="page-about-tank-man-photo.html">More
information</a></details>
</figure>

And for an iframe:

<iframe title="Cool Widget"
aria-describedby="widget-desc"
src="http://cool-widget.example.com/user/remco">
<p id="widget-desc">All visiting IP addresses and their browsing
history as tracked by Example Inc. are displayed in a list. <a
href="bigbrother.html">More information</a>.</p>

Or:

<figure>
<legend>Cool Widget</legend>
<iframe src="http://cool-widget.example.com/user/remco">
<details><legend>Description</legend>All visiting IP addresses and
their browsing history as tracked by Example Inc. are displayed in a
list. <a href="bigbrother.html">More information</a>.</details>
</figure>

One advantage of this is that the alternative content is now by
default always visible (or can be made visible in the case of
<details>). That makes it much more useful for normal use cases (no
network problems or disabled audience), which means it would be
provided a lot more. This is a lot better than the current situation
with alt.

The question now is: why would we need both <figure> and aria-describedby?

Remco

Received on Monday, 10 August 2009 07:42:36 UTC