W3C home > Mailing lists > Public > whatwg@whatwg.org > June 2007

[whatwg] .localName shouldn't change case

From: Darin Adler <darin@apple.com>
Date: Fri, 29 Jun 2007 09:42:42 -0700
Message-ID: <69A5BCB9-F127-4D6F-90E6-98CCE443AD03@apple.com>
On Jun 29, 2007, at 9:15 AM, Simon Pieters wrote:

> For HTML elements in HTML documents, why is Element.localName  
> uppercased for tag names and lowercased for attribute names? I  
> wouldn't expect it to, and it makes it harder to write scripts that  
> work for both HTML and XHTML. For example, if you want a script to  
> work in both legacy HTML UAs and HTML5 UAs as well as in XHTML, you  
> may want to do something like if ((elm.tagName == "A" && ! 
> elm.namespaceURI) || (elm.localName == "a" && elm.namespaceURI ==  
> "http://www.w3.org/1999/xhtml")) to check that a given element is  
> an HTML "a" element.

Good timing, mentioning this.

WebKit uses lowercase for localName for HTML elements in HTML  
documents for the reasons you mention.

We received a bug report about a library, "Jira", that doesn't work  
with Safari 3 because of this <http://bugs.webkit.org/show_bug.cgi? 
id=14114>. We were surprised to learn that Mozilla uses uppercase.

     -- Darin
Received on Friday, 29 June 2007 09:42:42 UTC

This archive was generated by hypermail 2.4.0 : Wednesday, 22 January 2020 16:58:56 UTC