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

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

From: Boris Zbarsky <bzbarsky@MIT.EDU>
Date: Wed, 12 Mar 2008 16:00:45 -0500
Message-ID: <47D8447D.9060007@mit.edu>
To: liorean <liorean@gmail.com>
CC: "Web APIs WG (public)" <public-webapi@w3.org>

liorean wrote:
> As a disconnected node would not be in the node tree from document,
> can it match a query at all?

That's a really good question!   It seems to match in the webkit nightly 
I just tried here, as well as in IE8.  Simple testcase:

javascript:var n = 
document.createElement("div");n.appendChild(document.createElement("span"));alert(n.querySelector("span").tagName);

Paste this into your URL bar of choice.

A naive implementation in Gecko would also match such nodes unless they 
are purposefully excluded.

If the intent is that these nodes not match, the spec obviously needs to 
spell it out a lot more clearly than it currently does.

-Boris
Received on Wednesday, 12 March 2008 21:01:10 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Wednesday, 12 March 2008 21:01:10 GMT