W3C home > Mailing lists > Public > w3c-wai-er-ig@w3.org > March 2004

[check 7] ALT text can't be empty (null or all spaces) if image is used as an anchor

From: Chris Ridpath <chris.ridpath@utoronto.ca>
Date: Mon, 29 Mar 2004 10:35:53 -0500
Message-ID: <008101c415a3$858efe50$b040968e@WILDDOG>
To: "WAI ER IG List" <w3c-wai-er-ig@w3.org>
Cc: <andrew_kirkpatrick@wgbh.org>

Original message froward from Andrew Kirkpatrick below:
Regarding check #7:
http://checker.atrc.utoronto.ca/servlet/ShowCheck?check=7&lang=eng
----


I do wonder if it is better to separate this out a little.  All anchors need
text in one form or another.  It doesn't matter if the text is in alt or
straight text, just so long as it exists.  Perhaps a check: Anchor text
can't be empty.  This would cover <a href="#content"></a> as well as missing
alt text in anchors.

Once this is covered, all you need to worry about with images is the
validity and then the common "bad alt" checks.

If a testing tool finds:
<a href="somewhere"><img src="rex.jpg" alt=""/></a>

It should flag two errors:
1) anchor text empty (definite error)
2) missing alt text (possible error)

I'd like the missing alt text to be a positive error, but am not sure how
that will work.

AWK


This should be ok:

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0
Transitional//EN""http://www.w3.org/TR/REC-html40/loose.dtd">
<html lang="en">
<head>
<title>OAC Testfile - Check #7 - Positive</title>
</head>
<body>
<a href="somewhere"><img src="rex.jpg" alt=""/>Rex</a>
</body>
</html>


This should be ok:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0
Transitional//EN""http://www.w3.org/TR/REC-html40/loose.dtd">
<html lang="en">
<head>
<title>OAC Testfile - Check #7 - Positive</title>
</head>
<body>
<a href="somewhere"><img src="rex.jpg" alt=""/><img src="rex.jpg"
alt="Rex"/></a>
</body>
</html>


This should be ok (there are better examples, but you get the point here):
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0
Transitional//EN""http://www.w3.org/TR/REC-html40/loose.dtd">
<html lang="en">
<head>
<title>OAC Testfile - Check #7 - Positive</title>
</head>
<body>
<a href="somewhere"><img src="rex.jpg" alt="Rex"/><img src="rex.jpg"
alt="the cat"/></a>
</body>
</html>
Received on Monday, 29 March 2004 10:37:46 GMT

This archive was generated by hypermail 2.2.0 + w3c-0.30 : Thursday, 9 June 2005 12:10:42 GMT