W3C home > Mailing lists > Public > public-webevents@w3.org > October to December 2012

Re: [Touch events] createTouchList should probably take a sequence, not an IDL array

From: Sangwhan Moon <smoon@opera.com>
Date: Thu, 29 Nov 2012 11:36:34 +0900
Cc: Arthur Barstow <art.barstow@nokia.com>, public-webevents@w3.org
Message-Id: <5B2E62F7-AE83-46D1-B82B-02B2E84AB843@opera.com>
To: Boris Zbarsky <bzbarsky@MIT.EDU>

On Nov 29, 2012, at 2:04 AM, Boris Zbarsky wrote:

> On 11/28/12 11:03 AM, Arthur Barstow wrote:
>> v1 is a CR now and we will soon start the interop testing to exit CR and
>> move to PR.
> 
> Yes.  I'm providing implementor feedback on the spec, like I'm supposed to in CR...
> 
>> It seems like the proposed API change would affect implementations
> 
> Actually, apart from black-box performance testing, it does not, precisely because the callee does not hold on to the list by reference.  It also doesn't affect them because there is nowhere to actually get a Touch[], so in practice callers will pass in a JS array, which will first get converted as if it were a sequence<Touch> anyway, then lead to creating an internal object to wrap the sequence, then will throw away that object at the end of the call.
> 
> Specifically, see http://dev.w3.org/2006/webapi/WebIDL/#es-array the "An ECMAScript value V is converted to an IDL array value of type T[] as follows:" bit and note that the first bullet point is always skipped in current implementations.

Thanks for pointing this out. Actually, in the scope of V1 it should have been:

TouchList createTouchList (Touch touch, ...);

...as the goal for V1 is to aim for interoperability. Both Touch[] and sequence<Touch>
are not interoperable, but your points make sense and if V2 was something that would
have been published we would have went for that. (Sadly, that's not the case.)

I'll need the group/chair to agree to the changes as it's a bit late in the stage though.

-- 
Sangwhan Moon, Opera Software ASA
Received on Thursday, 29 November 2012 02:37:17 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Thursday, 29 November 2012 02:37:17 GMT