Re: alt text on Validator.nu image report

Ian Hickson wrote:
> On Sat, 3 May 2008, Philip Taylor wrote:
>> So, the goal of the site's markup is to make sure the UA tells the user 
>> clearly and concisely that there is an image here. It is up to the UA to 
>> determine as much detail as possible about the image, and it is up to 
>> the user to decide (based on context) that the image is important and 
>> that it is worth looking at in detail.
>>
>> In that case, <img src="..." alt="External image"> seems to achieve the 
>> goal: as long as UAs do not ignore images with alt text, the user will 
>> be made aware that the image exists, and can ask their UA for further 
>> details.
> 
> Actually it doesn't, really. The intent of the alt="" attribute is to 
> provide text that can be used to completely replace the image, and thus 
> there isn't necessarily a way to distinguish this:
> 
>    <p><img src="x.png" alt="External image"></p>
> 
> ...from this:
> 
>    <p>External image</p>
> 
> ...in user agents that don't support images. In particular, a user agent 
> like Lynx wouldn't distinguish the two cases above, but would show the 
> image in the following case in a distinct UA-styled manner:
> 
>    <p><img src="x.png"></p>

That behaviour is not the most useful for the user: even if the alt text 
truly is an equivalent of the image and can completely replace it in the 
page, the user may want to save the image to disk so they can look at it 
later or upload it to their own site, or copy the URI to a friend who 
has a graphical UA, or activate their UA's advanced image analysis 
feature to get a detailed description (e.g. to find out the colours in a 
company's logo via an <img src="logo.png" alt="Megacorp Inc">).

Those cases require the UA to inform the user that there is an image and 
let the user select it so they can enter commands (to download, or to 
copy the URI, etc), regardless of whether there is alt text. <img 
alt=...> mustn't be treated as equivalent to plain text, else this 
functionality would be lost.

(The alt text may well be exactly equivalent to its image in an abstract 
sense of the 'meaning' of a document - but the web is all about people, 
using interactive UAs that convert byte streams into user interfaces, 
and it is harmful to consider only that abstract level and not the 
actual real users.)


Existing implementations seem to agree that they shouldn't provide 
functionality only on <img> and not on <img alt=...>:

By default, Lynx does not let the user select any image. With 
image_links mode on, Lynx allows both <img alt=...> and <img> to be 
selected.

By default, Links allows <img alt=...> to be selected, but not <img>. 
With "Display links to images" on, Links allows both <img alt=...> and 
<img> to be selected.

By default, ELinks allows both to be selected. With "Display links to 
images" off, ELinks allows neither to be selected.

By default, VoiceOver in Safari allows both to be selected. With 
"Navigate Images" disabled, VoiceOver in Safari allows neither to be 
selected. (I can't find anything that is affected by the "Only navigate 
images with a description" option.)

By default, VoiceOver in Opera (9.5b2) allows <img alt=...> to be 
selected, but not <img>. With "Navigate Images" disabled, VoiceOver in 
Opera allows neither to be selected. (I still can't find anything that 
is affected by the "Only navigate images with a description" option.)

According to 
http://www.paciellogroup.com/resources/articles/altinhtml5.html , JAWS 
and Window Eyes by default announce <img alt=...> (do they let the user 
select it and e.g. download the image?), and do not announce <img>.


None of those UAs/configurations allow the user to interact usefully 
with <img> while not being able to with <img alt=...>, so <img alt=...> 
is never less useful than <img>. It would be harmful to users if these 
implementations started treating <img alt=...> as indistinguishable from 
plain text (since that would lose useful functionality), so that should 
not be the intent of the spec.

-- 
Philip Taylor
pjt47@cam.ac.uk

Received on Sunday, 4 May 2008 13:14:57 UTC