WebAIM - Web Accessibility In Mind

E-mail List Archives

Re: Question about image in the alt attribute

for

From: Jukka K. Korpela
Date: Aug 1, 2014 12:01PM


2014-08-01 20:06, Jonathan Metz wrote:

> In my opinion, there is no correlation between a specification addressing
> the purpose of an attribute and a supporting document's extrapolation of
> accessibility benefits for providing that attribute that would infer a
> preference for user agents.

What? That sounds hopelessly abstract.

> For one thing, Jukka only linked to it's relationship with the <src> tag,
> and seems to be hung up on the phrase "...when not available".

No, I did not mention the <src> tag (there is no such tag), and yes, I
am advocating the use of an alt attribute for the purpose it was
designed for and has been defined in HTML specifications.

> The requirements for the attribute is actually explained under 4.7.1.1, which
> references WCAG: alt attributes "are a primary way of making visual
> information accessible, because they can be rendered through any sensory
> modality (for example, visual, auditory or tactile) to match the needs of
> the user."

This simply means that the alt attribute is to be rendered *instead of*
the image. The phrase "making visual information accessible" is poorly
formulated, since alt attributes are not meant to make blind people see.
Instead, they are the way to make *some* information available to people
who do not see the image. That information is to be written by the
author, and it *should* correspond, as far as possible, the visual
information in the image. Realistically speaking, when the image is a
photo, for example, the alt text *cannot* correspond to the visual
information very well. Authors should do their best, but they should not
be required to do more.

The alt attribute is most useful when there is a simple text replacement
for an image, so obvious that anyone who sees the image and understands
its context can write the text in a second. Purely decorative images and
text as images are the most obvious cases. This is where the alt
attribute does its job well when written to act as a replacement, not a
description (say, "item" or "bullet", not "red fancy bullet with
blinking eyes").

>>> "Pure decoration." Too ambiguous a term. Undefined. Nearly everything
>>> that
>>> isn't text could end up classified as "pure decoration."
>
> Explained a little further down the page
> <http://www.w3.org/TR/WCAG20/#puredecdef>; as a definition: "Pure
> decoration: serving only an aesthetic purpose, providing no information,
> and having no functionality. Note: Text is only purely decorative if the
> words can be rearranged or substituted without changing their purpose.
> Example: The cover page of a dictionary has random words in very light
> text in the background."

That's a manifestly poor example. Those random words are excerpts from
the dictionary. When I look at them, I can see that it is an English
dictionary, or a French dictionary, or a Greek dictionary, or whatever
it might be. It's far from being "pure decoration".

But it's an image for which alt="" is adequate, on the simple grounds
that this is the only no-nonsense approach. There is no way (or at least
I cannot see a way) to present the same information in a non-visual way
in a similarly non-disruptive manner. If you make a speech browser speak
those words, or a Braille device present them, or a text-only browser
display them, you would be giving the same information, but in a wrong
way, disturbing the user rather than helping him.

It would be a different matter if the cover page did not contain a
normal title of the dictionary at all, just those random words. Then the
information conveyed by those words, in a rather implicit way, would be
too important for the context to be simply omitted. Then you should find
out what the dictionary really is about and say that in the alt
attribute, e.g. alt="An English dictionary of obscene words" or alt="A
French dictionary of cooking terms". If you cannot do that, and cannot
get help on it, the least of evils would be to write an alt attribute
that contains the words or some subset of them.

Yucca