Not all attributes get lowercased in the DOM

The note in section 3.2.3.8 goes to far:

]]
3.2.3.8 Embedding custom non-visible data
A custom data attribute is an attribute in no namespace whose name 
starts with the string "data-", has at least  one character after the 
hyphen, is XML-compatible, and contains no characters in the range 
U+0041 .. U+005A  (LATIN CAPITAL LETTER A to LATIN CAPITAL LETTER Z).

Note: All attributes in HTML documents get lowercased automatically, so 
the restriction on
uppercase letters doesn't affect such documents.
[[

The correct thing AFAIK is that *only* ASCII names get lowercased in the 
DOM. Non-ASCII attribute names stay as they are.

Thus the code

    <span DATA-ÆØÅ="foo">

in the DOM should become

    <span data-ÆØÅ="foo">

That said, assuming that IE7 and IE8 behaves like IE6, then only Firefox 
and Safari seem to behave like this. And only Firefox and Safari will 
lowercase new, unknown, attribute names at all.

I assume that the lowercasing of attribute names are mentioned also in 
other parts of the spec, but I did not check how it is described there.
-- 
leif halvard silli

Received on Monday, 19 October 2009 15:08:04 UTC