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

>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 UTC