[whatwg] getElementsByClassName case sensitivity

Ian Hickson ian at hixie.ch
Fri Jul 25 02:46:41 PDT 2008

On Sun, 9 Dec 2007, David Smith wrote:
> 	Currently getElementsByClassName is specified as always being case 
> sensitive. This would be fine, except that the primary other use of html 
> class names (CSS selector matching) is only case sensitive in "standards 
> mode". This leads to situations like 
> http://dscoder.com/getelementsbyclassname.html in which CSS and 
> getElementsByClassName match different results, which I think is a 
> rather unintuitive behavior. For this reason, I'd like to propose that 
> the case insensitivity quirk for class name matching be maintained in 
> getElementsByClassName. So far I've spoken to people on the Opera, 
> Firefox, and WebKit teams, and gotten responses ranging from agreement 
> to (paraphrasing) "I don't think it matters, but I'll implement 
> whichever way the spec ends up", so hopefully this won't be a 
> particularly controversial change to make.

I've made it consistent with how classes work in CSS (case-insensitive for 
quirks and case-sensitive otherwise).

Ian Hickson               U+1047E                )\._.,--....,'``.    fL
http://ln.hixie.ch/       U+263A                /,   _.. \   _\  ;`._ ,.
Things that are impossible just take longer.   `._.-(,_..'--(,_..'`-.;.'

More information about the whatwg mailing list