Re: TIDY - Objects to euro symbol (?) & very pedestrian about ALT for gifs

Peter Evans <evans@i.hosei.ac.jp> wrote:
>html-tidy@war-of-the-worlds.org wrote:

>>It is generally safe to assume that single-pixel height
>>or width images are either transparent or purely decorative
>>and thus can be provided with alt="" if an alt attribute
>>is absent.

>First, I can't see how alt="" can be an improvement over no alt at all.
>It seems to me that you'd (or the program would) be adding seven bytes
>for no purpose whatever.  (But see below!)

The browser lynx will provide [IMAGE] alt text for images which lack alt
text, and [LINK] when they are wrapped in anchors, which will get in the
way of screen readers, so even empty alt attributes have a purpose.
Additionally, the alt attribute is REQUIRED by HTML 4.x and XHTML, so they
MUST be there (preferably containing meaningful text, but only when the
image itself is meaningful).

>Secondly, I thought these single-byte GIFfies were often used in stretched
>form. If so, height and width could be considerable.

Single-pixel.  And the file sizes for these have been known to be under 50
bytes, but it is impossible for a GIF to have a file length of one byte.

>I'd suggest having Tidy add alt="" to any alt-less image.

For images that actually serve a purpose (linked images), this would be
worse than nothing as it would make those links unnavigable by standard
configurations of lynx.  And with the prevalence of images containing text,
in many cases it is essential that the images have meaningful alt text.

I do understand though that HTML Tidy can be configured to provide a
user-defined string as alt text for images with no alt attributes.  That
should be sufficient for your purposes.

>Then the
>webmeister could (i) go through the resulting file, adding the text
>between the quotation marks where appropriate,

Tidy should not rely on its user to fix up mistakes it makes, lest the user
take the lazy route and do nothing at all.

>and then (ii) zap all
>remaining examples of alt="".

That would result in an invalid HTML file.  You can't delete ("zap") the
alt attributes and still have a valid document.  A reading of the DTD alone
would show you that.

>(Perhaps this is what Tidy already does;
>I don't know, because adding alt="explanation" to my graphics is one of
>the few things I manage to do consistently and competently without
>Tidy's help.)

I hesitate to ask, but you do know that alt texts are for alternative text
to be displayed only when the image is not displayed, and not an
"explanation" (and not as tooltip text), right?  Sometimes the best
alternative for a meaningless image is an empty string.
-- 
         ,=<#)-=#  <http://www.war-of-the-worlds.org/>
    ,_--//--_,
 _-~_-(####)-_~-_  "Did you see that Parkins boy's body in the tunnels?" "Just
(#>_--'~--~`--_<#)  the photos.  Worst thing I've ever seen; kid had no face."

Received on Sunday, 30 April 2000 00:52:23 UTC