W3C home > Mailing lists > Public > public-script-coord@w3.org > April to June 2013

Re: Allowing IDL attributes to have different types for the getter and setter

From: David Bruant <bruant.d@gmail.com>
Date: Thu, 18 Apr 2013 09:39:55 +0200
Message-ID: <516FA34B.2020509@gmail.com>
To: Domenic Denicola <domenic@domenicdenicola.com>
CC: Boris Zbarsky <bzbarsky@MIT.EDU>, "public-script-coord@w3.org" <public-script-coord@w3.org>
Le 18/04/2013 04:20, Domenic Denicola a écrit :
> From: Boris Zbarsky [mailto:bzbarsky@MIT.EDU]
>
>> On 4/17/13 9:58 PM, Domenic Denicola wrote:
>>> That sounds like a bizarre API to me. Access or properties should, as much as possible, behave just like normal data properties.
>> OK.  What would you like to see for the specific API under discussion here?
> Assuming I'm understanding the background reading correctly,
>
>      myFileInput.files = new FileList([aFile]);
>      myFileInput.files = new FileList([bFile, cFile]);
>
> seems like the way to go. As long as, generally,
>
>      var x = someThingOfTheCorrectType;
>      y.z = x;
>      assert(y.z === x);
>
> passes, then we're in good shape.
A spec nit along the way: note that although I agree with your 
intention, WebIDL imposes to break ===  whenever a conversion is 
performed in a *lot* of occasions. See the step 4 of the attribute 
getter algorithm [1].

That's a nit, but one to be aware of, especially when dealing with 
WebIDL types that are short ints.

David

[1] http://www.w3.org/TR/WebIDL/#dfn-attribute-getter
Received on Thursday, 18 April 2013 07:40:27 UTC

This archive was generated by hypermail 2.3.1 : Tuesday, 6 January 2015 21:37:49 UTC