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

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

From: liorean <liorean@gmail.com>
Date: Wed, 12 Mar 2008 23:13:27 +0100
Message-ID: <cee13aa30803121513l623d5cc7y4e154b66052d6fb0@mail.gmail.com>
To: "Web APIs WG (public)" <public-webapi@w3.org>

>From earlier discussion on this topic I got the impression that the
intention for the ElementSelector interface was that it would still be
document-rooted. In other words, if you have a selector ":root
descendant" and operate on an element that is not the documentElement,
but which has a descendant child, then the descendant child will
match.

In this traversal scheme, querying the selector is still done from the
document node, just excluding all subtrees except for the subtree of
the element we're querying on.

Another alternative is of course to do the matching backwards,
beginning with trying to match the last simple selector in the
selectors on each of the elements of the subtree in question, then
traversing the tree in upwards direction.

The first traversal scheme would never match disconnected nodes. The
second would, however. Then there's of course a possibility to create
a hybrid version of these approaches.
-- 
David "liorean" Andersson
Received on Wednesday, 12 March 2008 22:13:40 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Wednesday, 12 March 2008 22:13:41 GMT