- From: Gavin Kistner <gavin@phrogz.net>
- Date: Tue, 18 Nov 2008 21:29:17 -0700
- To: public-webapps@w3.org
Section 6 states: "The querySelector() method ... must ... return the first matching Element node ***within the node’s subtree***." [1] "The querySelectorAll() method ... must ... return ... all of the matching Element nodes ***within the node’s subtree***..." [2] (Emphasis mine.) In conflict, Section 8 (Examples) states: "Even though the method is invoked on an element, ***selectors are still evaluated in the context of the entire document***. In the following example, the method will still match the div element's child p element, even though the body element is not a descendant of the div element itself." [3] (Emphasis mine.) As Section 8 is non-normative (being an example, as covered under section 2), I assume that it is wrong. I agree with the specifications as stated in section 6: invoking the methods on a node should only match against the subtree of that node (or possibly the node and its subtree), not the entire document. [1] http://www.w3.org/TR/2008/WD-selectors-api-20081114/#queryselector [2] http://www.w3.org/TR/2008/WD-selectors-api-20081114/#queryselectorall [3] http://www.w3.org/TR/2008/WD-selectors-api-20081114/#examples0
Received on Wednesday, 19 November 2008 04:30:06 UTC