Re: ACTION-87: Selectors API

Anne van Kesteren wrote:
> Hi all,
>
> During the F2F I got an action assigned to me to draft something up 
> for getElementsBySelector(). Basically a method that would take a 
> selector[1] as argument and return a (static) list of elements. In the 
> current draft (attached) there is also an optional second argument 
> that takes an XPathNSResolver as argument. Might be a bit funny to see 
> things from the XPath API being reused in the one for Selectors, but 
> it seemed like the best and easiest solution.
>
> It is not clear at all if the WG will pursue working on this. Probably 
> depends on community input and if we think it's worth it. Now there is 
> at least something to discuss about.
>
> Cheers,
>
> Anne
>
>
> [1]<http://www.w3.org/TR/css3-selectors/>
Hi Anne,

This seems like a really good idea. I'm not sure about the method name.

getElementById(), getElementsByTagName(), etc. use a "property" of the 
elements to select them, here the id and the tag name (element type 
name). An element doesn't really have its own "selector", though. 
Therefore I think another name should be used, such as selectElements(). 
The best argument against this idea of mine is that getElementBy*() is 
already being used for all selecting.


Cheers,
Daniel Schierbeck

Received on Saturday, 25 February 2006 18:19:11 UTC