W3C home > Mailing lists > Public > public-webapps@w3.org > April to June 2011

More questions about contextual reference nodes

From: Boris Zbarsky <bzbarsky@MIT.EDU>
Date: Sat, 09 Apr 2011 01:12:48 -0700
Message-ID: <4DA01500.5020105@mit.edu>
To: Lachlan Hunt <lachlan.hunt@lachy.id.au>
CC: public-webapps <public-webapps@w3.org>
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
Received on Saturday, 9 April 2011 08:13:21 GMT

This archive was generated by hypermail 2.3.1 : Tuesday, 26 March 2013 18:49:44 GMT