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

Re: [selectors-api] Why no querySelector(All) on DocumentFragments?

From: Jonas Sicking <jonas@sicking.cc>
Date: Fri, 14 Mar 2008 13:56:40 -0700
Message-ID: <47DAE688.2070306@sicking.cc>
To: Maciej Stachowiak <mjs@apple.com>
CC: Boris Zbarsky <bzbarsky@MIT.EDU>, "Web APIs WG (public)" <public-webapi@w3.org>

Maciej Stachowiak wrote:
> On Mar 12, 2008, at 12:25 PM, Boris Zbarsky wrote:
>> Is there a reason why querySelector(All) is not supported on 
>> DocumentFragment nodes?  It seems to me that such support could be 
>> useful...  It's already supported on disconnected subtrees rooted by 
>> an Element, as far as I can tell, so it doesn't seem like the 
>> DocumentFragment case would be all that different.
> I'd have no objection to supporting these methods on DocumentFragment 
> too, although it does not seem terribly important.

If we merge DocumentSelector and ElementSelector into simply 
NodeSelector we'll more or less automatically get the functions on 

We'd also get it for attribute nodes which might be less desirable. 
Though we could say that the interface is only required to be 
implemented on Documents, Elements and DocumentFragments.

I don't feel strongly either way about that.

> I think ability to do element-rooted selector queries (either through a 
> new method or a :scope pseudo-element) is more important, since it's 
> needed to replicate the feature set of JS query libraries.

If we could get a :scope pseudo-element that would be an excellent 
solution IMHO, and would be great with scoped stylesheets as has been 
pointed out elsewhere in the last few days.

Is that something that should be defined by this WG? It would suck to 
have to wait for Level 4 Selectors. Other WGs have defined selectors, 
but I'm not sure how good of an idea that is.

The alternative, defining another set of methods would be something that 
we could do, but that solution feels a lot less appealing.

/ Jonas
Received on Friday, 14 March 2008 20:57:47 UTC

This archive was generated by hypermail 2.3.1 : Tuesday, 6 January 2015 21:16:25 UTC