W3C home > Mailing lists > Public > public-webapi@w3.org > December 2006

Re: Selectors API naming

From: Ian Hickson <ian@hixie.ch>
Date: Thu, 21 Dec 2006 23:35:53 +0000 (UTC)
To: Anne van Kesteren <annevk@opera.com>
Cc: "Web API WG (public)" <public-webapi@w3.org>
Message-ID: <Pine.LNX.4.62.0612212300200.10136@dhalsim.dreamhost.com>

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 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Tuesday, 8 January 2008 14:18:56 GMT