W3C home > Mailing lists > Public > public-script-coord@w3.org > October to December 2011

Re: [WebIDL] Simplify callbacks

From: David Flanagan <dflanagan@mozilla.com>
Date: Wed, 09 Nov 2011 08:59:44 -0800
Message-ID: <4EBAB180.9080508@mozilla.com>
To: Robin Berjon <robin@berjon.com>
CC: Anne van Kesteren <annevk@opera.com>, public-script-coord@w3.org
On 11/9/11 8:32 AM, Robin Berjon wrote:
> On Nov 9, 2011, at 16:22 , Anne van Kesteren wrote:
>> On Tue, 08 Nov 2011 13:23:13 -0700, David Flanagan<dflanagan@mozilla.com>  wrote:
>>> On 11/8/11 6:47 AM, Anne van Kesteren wrote:
>>>> addEventListener(DOMString type, Callback(Event)? listener, optional boolean capture)
>>> How about Callback means [Callback=FunctionOnly].  I.e.: you have to pass a function.  New interfaces could use this.
>>> And EventCallback means [Callback] EventListener.  I.e. you can pass a function or any object with a handleEvent() method.  Legacy APIs (and new Event apis) can use that.
>>> Some other thoughts:
>>> - If these are going to be parameterized with the argument type, it seems like the WebIDL precedent is angle brackets as in sequence<DOMString>.
>> What do you mean here?
> It's not 100% clear to me whether you wrote "Callback(Event)?" to mean "CallbackEvent or just Callback" or as a nullable Callback parameterised with Event. If the latter (which I think is the case), I believe that David is suggesting Callback<Event>  for consistency with sequence<Foo>.
Yes, that's exactly what I meant.

Received on Wednesday, 9 November 2011 17:00:22 UTC

This archive was generated by hypermail 2.4.0 : Friday, 17 January 2020 17:14:04 UTC