Re: case sensitivity and the OM

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 UTC