W3C home > Mailing lists > Public > public-html@w3.org > October 2009

Not all attributes get lowercased in the DOM

From: Leif Halvard Silli <xn--mlform-iua@xn--mlform-iua.no>
Date: Mon, 19 Oct 2009 17:07:28 +0200
Message-ID: <4ADC80B0.6070107@xn--mlform-iua.no>
To: HTMLWG <public-html@w3.org>
The note in section goes to far:

]] 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 

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

This archive was generated by hypermail 2.4.0 : Saturday, 9 October 2021 18:45:00 UTC