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

Re: [WebIDL] Representing functions that user code can call

From: Cameron McCormack <cam@mcc.id.au>
Date: Sun, 09 Dec 2012 11:07:31 +1100
Message-ID: <50C3D643.4060807@mcc.id.au>
To: Boris Zbarsky <bzbarsky@MIT.EDU>
CC: public-webapps <public-webapps@w3.org>
On 8/12/12 1:56 PM, Boris Zbarsky wrote:
> We have a way to represent user functions that platform objects can
> call: callbacks.
> But I don't think there's really a good way to represent functions that
> are not hanging off any particular object that user code can call.  Or
> can callbacks be used for that too?

Is this for

   partial interface Document {
     Function register(DOMString name, optional Options options);

?  Despite the name "callback function", I think they could be used 
here.  I don't think there's anything in the spec that prevents platform 
objects from providing values of this type.

> Note that right now the web components spec is using callbacks for this,
> but they're not a great fit given how callback conversions between
> WebIDL and ES are defined...

What about the conversion is a bad fit?

> What's really wanted for this sort of use case is something closer to
> how Constructors are defined: basically a standalone WebIDL operation,
> not hanging off any object.

Maybe we could just rename callback functions to functions, and have 
them work both for user-provided and platform-object-provided Function 
Received on Sunday, 9 December 2012 00:08:19 UTC

This archive was generated by hypermail 2.3.1 : Friday, 27 October 2017 07:26:50 UTC