Re: Error checking attribute ALT

Anne van Kesteren wrote:

> On Wed, 06 May 2009 22:21:54 +0200, Jukka K. Korpela
> <jkorpela@cs.tut.fi> wrote:
>> Anne van Kesteren wrote:
>>> You can only use the alt attribute on <input> if the type
>>> attribute specifies image.
>>
>> That's something that a wannabe excuse for a draft of a specification
>> wants to say. According to DTDs in published specifications, no such
>> restriction is possible. It's also a restriction that published HTML
>> specifications do not make in prose.
>
> It is the reason however, that the validator gives that message, as
> far as I can tell.

Well, it's rather the odd kludge embedded into the validator that does some 
checks and decides to issue opinions on such grounds - if you have chosen to 
use the "HTML5" feature.

I'm not against experiments and heuristic checkers ("linters"), but I'm 
against confusing people about the already confused issue of markup 
validation. The "HTML5" feature has just been packged together with a markup 
validator. If you are serious about HTML5, then the feature might be useful 
to you.

Oddly enough, when I tested a document containing <input alt="">, the 
"HTML5" feature told me:

 Line 7, Column 22: Required attributes missing on element input.
<div><input alt="foo"></div>Element-specific attributes for element input:

followed by a list of attributes (as links that don't work). When I played 
more by adding type=text (completely redundant by all HTML specifications), 
then it started complaining about the alt attribute.

-- 
Yucca, http://www.cs.tut.fi/~jkorpela/ 

Received on Thursday, 7 May 2009 15:11:00 UTC