Re: Selectors, getElementsByTagName() and camelCase SVG

Maciej Stachowiak wrote:
> Oops, should have read this email before replying to the last one. Why 
> would this be bad?

Currently tag names in Gecko are stored as interned strings; comparisons 
are pointer comparisons.  These are also used as hashtable keys (in 
particular in style system matching, etc).

For HTML, all tag names are lowercased and then interned at parse time, 
in both the CSS parser and the HTML parser.

Switching to a setup where tagnames are stored in input case would 
require a pretty thorough rewrite of a lot of code.

But that's not needed, as far as I can tell.  Ithink the main point of 
Henri's mail was just that getElementsByTagName needs to clearly define 
how matching works for SVG.  The fact that Gecko would likely implement 
this by having an internal table of special tag names that must not be 
lowercased (and in fact must be canonically camelCased) in HTML seems 
like a black-box thing that's not exposed to the web.  The one case 
where interoperability issues could arise is for unknown tags; both HTML 
and SVG.  It's not clear to me what, if anything, the spec currently 
requires the behavior to be there (in terms of things like tagName, 
localName, etc).

-Boris

Received on Wednesday, 1 April 2009 19:29:25 UTC