W3C home > Mailing lists > Public > public-html-comments@w3.org > August 2011

Re: Proposal: ALT attribute for text

From: T.J. Crowder <tj@crowdersoftware.com>
Date: Thu, 25 Aug 2011 08:26:25 +0100
Message-ID: <CAH65x-zZfqWpV4Xyu4jtwWEZ6r7x6OK45u0Tp6AEpTGZh_U2qg@mail.gmail.com>
To: Charles Pritchard <chuck@jumis.com>, "Jukka K. Korpela" <jukka.k.korpela@kolumbus.fi>, public-html-comments <public-html-comments@w3.org>
On 25 August 2011 07:32, Charles Pritchard <chuck@jumis.com> wrote:
> There are certainly difficulties in requesting titles. Consider cases when
> users are uploading to an online forum, or a site, like Blackboard-- in
> those cases, it's fairly easy to make adding a title a part of the
> process... [...]
> There is then, the more difficult case, where users are uploading multiple
> images, and asking them to label each image immediately would not desirable.
> In those cases, again, it makes good sense to allow the user to update the
> titles later, and to grant them a tool to help them see which images are not
> labeled.
> [...]
> Consider that, when a user sees a "caption this image" option, they may add
> some kind of subtitle which makes a pun, or otherwise adds to the image.
> That's fun, and useful, but it's not so useful for non-sighted users. And
> that's where, again, the software that is being used can be a big help. It
> can and should allow the user to write in descriptive captions, additive
> captions, short captions, and so forth. But, most software was not designed
> from that premise.
> All of those caption types could be worthwhile for a user to provide. But
> the tool has to allow them that provision.

`alt` specifically *isn't* for captions, titles, etc. From section<http://www.w3.org/TR/html5/embedded-content-1.html#alt>

"A corollary to this is that the `alt` attribute's value should never
contain text that could be considered the image's *caption*, *title*, or *
legend*. It is supposed to contain replacement text that could be used by
users *instead* of the image; it is not meant to supplement the image. The
`title` attribute can be used for supplemental information."

On 25 August 2011 07:32, Charles Pritchard <chuck@jumis.com> wrote:

> On 8/24/11 10:41 PM, Jukka K. Korpela wrote:
>> In some use cases, it would suffice to define as follows: an alt attribute
>> on a <span> element or other phrase element indicates the text to be used in
>> place of the element content, if the content cannot be presented as graphic
>> characters; for example:
>> <span alt="diameter">&#x2300;</span>
>> or
>> <span alt="">&#x2300;</span>
>> (A browser would be expected to use the alt fallback if it cannot render
>> the content as the diameter sign, probably due to lack of such character in
>> available fonts. And maybe the idea could be extended to rendering content
>> non-visually; in that case, only the former fallback would make sense.)
>>  I think that font fallback is a different issue, widely handled by
> Unicode related standards.


On 25 August 2011 07:32, Charles Pritchard <chuck@jumis.com> wrote:

> Wouldn't something like this work out?:
> <span role="img" aria-label="diameter">&#x2300;**</span>

Or taking it back to Dr. Goss' use case:

<span role="img" aria-label="fingering holes 1 to 3


<span alt="fingering holes 1 to 3 closed">&lt;xxx|ooo</span>

The word "label" is problematic. The ARIA specification talks about labels
being names, descriptions, or both -- but doesn't talk about them being *
replacements*. However, in section<http://www.w3.org/WAI/PF/aria/roles#textalternativecomputation>they
seem to be saying that "label" serves the same purpose as `alt`:

"If `aria-labelledby` and `aria-label` are both empty or undefined, and if
the element is not marked as presentational (role="presentation"), check for
the presence of an equivalent host language attribute or element for
associating a label, and use those mechanisms to determine a text
alternative. For example, in HTML, the `img` element's `alt` attribute
defines a label string and the label element references the form element it

So it would seem that ARIA's "label" is meant for this purpose, though I'd
say it's far from clear.

Having looked into it more, I'm liking this `alt` proposal, and partially
because of Dr. Goss' point that the simpler it is to use, the easier it will
be to get people to use it.

It would be important to be clear that its purpose is specifically *verbal
replacement*. User agents that can't display images but can display text
(and so would use `alt` of img) should continue to display the main text of
the element in this case; this use-case is specifically that that text
cannot be rendered verbally and this alternate text should be used instead.
(That makes it sound like an edge case, but of course it isn't -- screen
readers are one of the most-used assistive technologies.)

But why just spans? It seems to me it applies equally to divs, and there may
be an argument that it applies to any element whose content model includes
"phrasing". Requiring authors to add a span purely to provide the `alt`
starts sounding complex again.
T.J. Crowder
Independent Software Engineer
tj / crowder software / com
www / crowder software / com
Received on Thursday, 25 August 2011 07:27:12 UTC

This archive was generated by hypermail 2.3.1 : Tuesday, 6 January 2015 20:26:27 UTC