Re: Selectors API naming

On Thu, 21 Dec 2006, Anne van Kesteren wrote:
> 
> Currently the following methods exist:
> 
>  * document.getElementsByTagName()
>  * document.getElementsByName() (HTML only)
>  * document.getElementById()
> 
> The following method is proposed by the WHATWG:
> 
>  * document.getElementsByClassName()

We should also not forget:

   * document.all
   * document.evaluate
   * document.selectNodes (XML only)
   * document.selectSingleNode (XML only)
   * document.getAnonymousNodes (XBL1 only)
   * document.getAnonymousElementByAttribute (XBL1 only)

...all of which are implementing and shipping. (In the case of 
document.all, my data indicates that it is used in around the same order 
of magnitude of pages as getElementById(), not counting cases like "if 
(document.all)", though of course since this is scripting it's very hard 
to tell for sure exactly what was going on.)

The feedback I've heard from devs at Google is that 
document.getElementsBySelector() is fine, so I'm happy either way.

I still say that this should just be up to the editor, though. IMHO 
forcing editor decisions is not a good way to get a spec. Editors should 
own their specification and be responsible for changes and decisions. 
Naturally, this should be based on all the feedback received, but 
sometimes overall spec quality argues that not everyone can be happy. 
Having compromises where everyone "can live with it" means that the 
overall quality is lower for everyone. Then we all lose.

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

Received on Thursday, 21 December 2006 23:36:05 UTC