W3C home > Mailing lists > Public > www-style@w3.org > December 2012

Re: case sensitivity and the OM

From: Boris Zbarsky <bzbarsky@MIT.EDU>
Date: Mon, 17 Dec 2012 16:46:53 -0800
Message-ID: <50CFBCFD.7080700@mit.edu>
To: www-style@w3.org
On 12/17/12 4:37 PM, John Daggett wrote:
> This already happens, this is why <mar[kelvin]> ends up in the DOM as
> <mark> [1].

Note that this only happens in browsers that are not actually following 
the HTML and DOM spec drafts...

> It's an artifact of ASCII case insensitivity not being defined
> precisely.

Actually, the behavior of <mar[kelvin]> is precisely defined in the 
spec.  It's just that not all UAs are implementing what the spec very 
clearly says.

> Huh, you say?  Seems like a no-brainer but ASCII case
> insensitivity can be defined as either (1) lowercase the characters
> [A-Z] in both strings and compare characters

This is how the HTML spec defines it.  See 
http://www.whatwg.org/specs/web-apps/current-work/multipage/infrastructure.html#case-sensitivity-and-string-comparison 
the definition of "ASCII case-insensitive".  See also the definitions of 
"Converting a string to ASCII lowercase" and "Converting a string to 
ASCII uppercase" in the same section.

Note that http://dom.spec.whatwg.org/#dom-document-createelement says 
"If the context object is an HTML document, let localName be converted 
to ASCII lowercase." where that last bit is a link to 
http://dom.spec.whatwg.org/#converted-to-ascii-lowercase which uses the 
exact same wording.

-Boris
Received on Tuesday, 18 December 2012 00:47:28 GMT

This archive was generated by hypermail 2.3.1 : Tuesday, 26 March 2013 17:21:03 GMT