I have two questions about http://www.w3.org/TR/selectors-api2/#determine-contextual-reference-nodes

1) What are the use cases for supplying more than one contextual reference node, exactly? It seems weird to allow more than one node to match :scope.

2) If we do want to allow the multiple node thing, can we please do it in IDL instead of the (currently pretty vague) prose? Something like:

  Element querySelector(in DOMString selectors,
                        in optional Element refElement);
  Element querySelector(in DOMString selectors,
                        in optional NodeList refElements);
  Element querySelector(in DOMString selectors,
                        in optional sequence<Element> refElements);

or some such? It's not quite clear to me whether we want a "sequence<Element>" or a "T[]"; that's worth checking. In either case, the prose will need to define what happens with the NodeList or sequence/array cases, but there will be no ambiguity about how one gets Elements out of what's passed in. The one difference is that in the array case if non-elements are present in the array an exception will be thrown. I think that's fine, myself.

-Boris

Reply via email to