[whatwg] Context help in Web Forms

Henri Sivonen hsivonen at iki.fi
Tue Jun 3 11:51:39 PDT 2008

On Jun 2, 2008, at 15:40, Matthew Paul Thomas wrote:

> The disadvantage of using a data-* attribute is that more kinds of
> mistakes would be undetectable by a validator. It would have no idea
> that (a) the value of the attribute must be the ID of an element
> elsewhere in the document, and (b) each value must be unique within  
> the
> document.
> I wonder if the data-* attribute naming scheme could be classified
> somehow to allow basic type checking like this. I expect there will be
> other cases where authors want an attribute value to match the ID of  
> an
> element in the page.

I don't like the idea of trying to encode the datatypes of data-*  
attributes in a validator-sensitive way. What datatypes would a  
validator support for data-* attributes? The HTML5 datatype library  
used by Validator.nu already contains 41 datatypes, but people will  
likely want to have others. The whole point of data-* is to provide a  
place where a validator doesn't go without authors having to abuse  
e.g. title which is a freeform but exposed to humans.

The foreseeable problem with data-* is, of course, that microformat- 
like activity will happen there instead of going through the trouble  
of getting unprefixed validator-sensitive attributes minted with  
community review in the WHATWG and the HTML WG.

Henri Sivonen
hsivonen at iki.fi

More information about the whatwg mailing list