[html4all] alt attribute applied to other elements
Robert J Burns
rob at robburns.com
Tue Aug 26 13:13:31 PDT 2008
Hello 4all,
So Ian has basically returned the draft to the original state that
raised so many objections. For images where the author doesn't want to
provide alt text she need not provide alt text: or as Ian is so fond
of calling the willful omission of alt text: "Images whose contents
are not known". Except now in addition to requiring such images to be
wrapped in a figure element with some text, he now also permits a
title of the image to replace the alt text using either the title
attribute or the a heading element.
Again his only goal seems to be to introduce a loophole so that
basically alt does not show up in conformance checkers (since the
conformance checker cannot possibly differentiate these cases from all
others and therefore cannot flag any IMG omitting the alt attribute as
an error). Ian's examples are: a webcam, automated embedding (again
equality, fraternity and equal rights for machines!), and blind
authors (let's not discriminate against the disabled here). The webcam
is a misguided example. The important thing to describe with a webcam
in its alt text is what the purpose of the webcam is (e.g., "The
Eiffel Tower from the North" or "affixed to my forehead as I tour the
World" if these are not provided in the caption, otherwise alt='').
The other two examples are precisely the examples where I feel
strongly the draft should not treat as conforming HTML. These examples
constitute HTML that has been incompletely authored and the absence of
the alt attribute can be an indication of that state. But there is no
reason to also make it conforming.
All that aside:
There are two cases the HTML5 draft covers for alt that I feel should
be handled by permitting (and even requiring) the alt attribute on
elements other than IMG.
The HTML5 draft covers 10 worthwhile cases[1]. They are (with proposed
role keywords[2] in parentheses):
• link — required
• charts, etc.(chart, diagram, geomap) — required
• icons and logos (icon, logo) — required
• text (text, mathexpr, musicscore) — required
• Illustrative of the nearby text (illustrative) — null required
• Decorative (decorative) — null required
• image that is part of a larger sliced image — ?
• image that is part of a larger sliced image with links — ?
• either a key part or \the\ key part of the content — required
except now we're back to the not required if the author doesn't want
to bother
• img hacks
The 11th situation[3] where authors think they know the audience for
their HTML just doesn't need to be addressed. I already know I can
send HTML to my mother even if its not conforming. I don't need Ian or
HTML5 to OK that.
However, there are two other cases that I think suggest alt should be
permitted elsewhere. The first case of a link (and I've brought this
up before) is where the author provides alt text to describe where a
link will take the user. To me this belongs on the A (anchor) element
and not on the image. I think it is easier for authors to understand
on the anchor than on the IMG. Also it may be that the IMG element
needs descriptive of the image alt text while the link needs alt text
descriptive of the link destination. Finally, I think it would be easy
for conformance checkers to alert authors of the needed alt text
whenever an anchor fails to contain significant text either in its
contents or in its alt attribute.
The other case is that of image slices. Personally, I think client-
side image maps might be a better technique than image slices for the
use case, but when authors do use image slices I think we should
require the element containing the slices (perhaps a DIV or a TABLE)
also accept the alt attribute. I suppose for TABLE the summary
attribute could be used (if we're keeping it), but the alt attribute
would be better since it could be used automatically without querying
like the summary attribute (and it could also be either a table or a
div that contained the image slices).
Take care,
Rob
[1]: <http://www.whatwg.org/specs/web-apps/current-work/#alt>
[2]: <http://esw.w3.org/topic/PF/XTech/HTML5/RoleAttribute#head-610fd0a42b1d8af2253378db31d9d28bd22988b9
>
[3]: <http://www.whatwg.org/specs/web-apps/current-work/#an-image0>
More information about the List_HTML4all.org
mailing list