Re: [selectors-api] Matching subtrees or not

2008-11-19 Thread Gavin Kistner
On Nov 19, 2008, at 11:02 AM, Boris Zbarsky wrote: Gavin Kistner wrote: Section 6 states: "The querySelector() method ... must ... return the first matching Element node ***within the node’s subtree***." [1] That's correct. The Element must be matching, and must be insid

Re: [selectors-api] Names of querySelector() and querySelectorAll() methods

2008-11-18 Thread Gavin Kistner
On Nov 18, 2008, at 9:32 PM, Gavin Kistner wrote: I find these names rather cumbersome and not very self-explanatory. Though it may be far too late for this suggestion, I would suggest that they should be something such as: findNode()/findNodes() or findNode()/findAllNodes() selectNode

[selectors-api] Names of querySelector() and querySelectorAll() methods

2008-11-18 Thread Gavin Kistner
I find these names rather cumbersome and not very self-explanatory. Though it may be far too late for this suggestion, I would suggest that they should be something such as: findNode()/findNodes() or findNode()/findAllNodes() selectNode()/selectNodes() or selectNode()/selectAllNodes() findBy

[selectors-api] Matching subtrees or not

2008-11-18 Thread Gavin Kistner
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 confli

Re: [selectors-api] Liveness versus NodeList

2008-11-18 Thread Gavin Kistner
On Nov 18, 2008, at 9:04 PM, Gavin Kistner wrote: I recommend specifying a new derivative StaticNodeList type as the return value. I do not recommend using an actual live NodeList, as I agree with both the end-user usefulness and performance benefits of not having a live NodeList

[selectors-api] First element example

2008-11-18 Thread Gavin Kistner
The second example in section 8 uses the following code: var x = document.querySelector("#foo, #bar"); It goes on to rather explicitly state, "In the sample document above, it would select the div element with the ID of foo because it is first ***in document order***" (my emphasis). None

[selectors-api] Liveness versus NodeList

2008-11-18 Thread Gavin Kistner
DOM Level 2 Core and DOM Level 3 Core both say: "The NodeList interface provides the abstraction of an ordered collection of nodes, without defining or constraining how this collection is implemented. NodeList objects in the DOM are live." [1] [2] " NodeList and NamedNodeMap objects in th

[selectors-api] Typo in Example

2008-11-18 Thread Gavin Kistner
The Selectors API document, section 8, has this example code: var div = document.getElementById("bar"); var p = bar.querySelector("body p"); I assume that is supposed to be either... var div = document.getElementById("bar"); var p = div.querySelector("body p"); ...or... var bar = docum