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

Re: More questions about contextual reference nodes

From: Lachlan Hunt <lachlan.hunt@lachy.id.au>
Date: Wed, 13 Apr 2011 12:20:15 +0200
Message-ID: <4DA578DF.8040701@lachy.id.au>
To: Boris Zbarsky <bzbarsky@MIT.EDU>, public-webapps <public-webapps@w3.org>
On 2011-04-13 06:32, Cameron McCormack wrote:
> Lachlan Hunt:
>>> OK. Then I'm not sure what the practical difference between the
>>> Element[] or sequence<Element>  would be then, nor which one to use.
>
> ... the only difference is that with Element[] you can distinguish
> between null and an array of [length 0], while with sequence<Element>  you
> can’t.

I don't think it's necessary to distinguish between null and length 0 
here, since they both mean that there are no contextual reference elements.

However, with the way in which the IDL is overloaded, it's not clear to 
me which of the two overloaded methods gets invoked when the parameter 
is null.

The IDL says:
   querySelector(in DOMString selectors, in optional Element refElement);
   querySelector(in DOMString selectors, in sequence<Node> refNodes);

When the author invokes:

   x.querySelector("a", null);

Does it invoke the method with refElement or refNodes?

(Although, in this case, it shouldn't matter, since the algorithm I 
wrote to determine contextual reference nodes ignores null in either case)

>>> While i<  n:
>>>
>>> Let x be the result of calling [[Get]] on V with property name ToString(i).
>>> Set Ei to be the result of converting x to an IDL value of type T.
>>
>> This step can throw (as part of the conversion process defined for
>> converting to type T); seems like that would involve throwing from
>> the whole algorithm.
>
> Yep.

Which conversion algorithm applies here?  Is it 4.1.15. object, or 
4.1.16. Interface types?

http://dev.w3.org/2006/webapi/WebIDL/#es-object

The former never throws, the latter will throw a TypeError. So am I 
right in assuming it's the latter?

-- 
Lachlan Hunt - Opera Software
http://lachy.id.au/
http://www.opera.com/
Received on Wednesday, 13 April 2011 10:20:46 GMT

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