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

Re: Selectors API naming

From: Joao Eiras <joao.eiras@gmail.com>
Date: Wed, 20 Dec 2006 13:45:56 -0000
To: "Web APIs WG" <public-webapi@w3.org>
Message-ID: <op.tku1uvoqxl3at9@dragast>

If you want to be accurate, the methods should be named

getElementByCSSSelector
getElementsByCSSSelector

and be integrated with the CSS DOM module.

There's one thing I don't understand ? Why returning a StaticNodelist ?
if I want something static I just use some xpath to get a snapshot.
CSS selectors are evaluated at runtime and are dynamic.
The NodeList should be live, else it beats the purpose of this method.


Robin Berjon <robin@berjon.com> escreveu:

>
> On Dec 19, 2006, at 17:51, Charles McCathieNevile wrote:
>> 1. Does anyone see any other issue in the current draft that should be  
>> fixed?
>> 2. For the following options, do you consider the names "fine", "not  
>> great but acceptable", or "unacceptable"?
>>      getElementBySelector/getElementsBySelector
>>      match/matchAll
>>      matchSelector/matchAllSelectors
>
> I find match and matchAll to be unacceptable. In terms of genericity,  
> usefulness, and actual deployed usage CSS comes third behind regular  
> expressions and XPath, both of which come to mind before CSS does.
>
> Beyond that I don't have a strong opinion but I find matchSelector/ 
> matchAllSelectors to be better due to being shorter (and not having a  
> zillion casing toggles like the gEBS).
>
> If you want a name that matches usage and the reality of what us  
> developers will understand intuitively, I would recommend matchCSS. It's  
> short, it's obvious, and it says exactly what it does.
>
Received on Wednesday, 20 December 2006 13:46:10 GMT

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