W3C home > Mailing lists > Public > public-webapi@w3.org > April 2008

getElementsBySelectoron all NodeLists

From: Ian Hickson <ian@hixie.ch>
Date: Tue, 15 Apr 2008 20:23:35 +0000 (UTC)
To: Sjoerd Visscher <sjoerd@w3future.com>, public-webapi@w3.org
Cc: Erik Arvidsson <erik@eae.net>
Message-ID: <Pine.LNX.4.62.0804152022380.3690@hixie.dreamhostps.com>

On Fri, 23 Sep 2005, Sjoerd Visscher wrote:
> Erik Arvidsson wrote:
> > I'm writing this to suggest a related method that takes an element and
> > returns true if it matches a CSS rule
> > 
> > interface GetElementsBySelector {
> >   NodeList getElementsBySelector(in DOMString cssSelector);
> > 
> >   // returns true if an element matches the given CSS selector
> >   boolean matchesSelector(in Element el, in DOMString cssSelector);
> > }
> > 
> > I'm not too sure about the name of this method so suggestions for a better
> > name are welcome (as well as any other comment of course).
> > 
> > Another thing that just I'm not too sure about is whether these should
> > include pseudo classes? It would be good but it makes things harder to
> > implement.
> > 
> > In the light of the bindings and behaviors scenario it would also be very
> > useful to have observers so one call tell when the matching changes. It
> > might be outside the scope of web apps 1.0 though?
> 
> These features would be nice for all methods that return NodeLists. As 
> NodeLists are live, adding a contains method, and a modification event 
> to the NodeList interface should cover all you need and much more.

Forwarding this feedback to public-webapi@w3.org, where this is now being 
developed.

-- 
Ian Hickson               U+1047E                )\._.,--....,'``.    fL
http://ln.hixie.ch/       U+263A                /,   _.. \   _\  ;`._ ,.
Things that are impossible just take longer.   `._.-(,_..'--(,_..'`-.;.'
Received on Tuesday, 15 April 2008 20:24:20 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Tuesday, 15 April 2008 20:24:21 GMT