Re: alt text on Validator.nu image report

On Sun, 4 May 2008, Philip Taylor wrote:
> >
> > 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">).

Sure, I didn't mean to imply that the image wasn't selectable. I'm just 
saying that the default representation would just show images the same as 
text (and different from, say, links) but that images without alternative 
text would be shown in a distinct way.


> 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.

It may be possible that the existing large amount of bogus missing-alt 
content makes the user agent processing I'm advocating here impractical.

An alternative would be to require alt="" to be specified on these images 
(e.g. with your suggestion "External Image", or "Photo", or whatever -- a 
caption, in this case, not an alternative) and then add a new attribute 
which means "This image is intended to be used as an image and cannot be 
considered equivalent to any text":

   <figure>
    <img src="1100670787_6a7c664aef.jpg" alt="Photo"
         importantimage="importantimage"/>
    <legend>Bubbles traveled everywhere with us.</legend>
   </figure>

Then, the alternative text (which would be required to be a short label 
for the kind of image being discussed, not its caption, not a description, 
and obviously not any kind of alternative or replacement) would be taken 
and made available to the user in a UI like this:

   [Image: Photo]

...in a manner clearly distinguishable from <span>Photo</span> and <img 
src="..." alt="Photo"> (and maybe more similar to <a href="">Photo</a>).

I'm not sure what the best attribute name would be for this.

Expected values for this attribute would be things like "Photo", "User- 
provided image", "Rorschach inkblot test", or similar; values that would 
otherwise be completely inappropriate for alt="".

It would then be non-conforming to have such alt text (text saying what 
kind of image is present as opposed to text that can replace the image 
altogether) _without_ this new attribute.

-- 
Ian Hickson               U+1047E                )\._.,--....,'``.    fL
http://ln.hixie.ch/       U+263A                /,   _.. \   _\  ;`._ ,.
Things that are impossible just take longer.   `._.-(,_..'--(,_..'`-.;.'

Received on Monday, 5 May 2008 01:18:28 UTC