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
DocumentFragments.
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