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

Re: [Bindings] extended attribute for callback function interfaces?

From: Jonas Sicking <jonas@sicking.cc>
Date: Sun, 23 Nov 2008 20:34:12 -0800
Message-ID: <492A2EC4.2040806@sicking.cc>
To: public-webapps@w3.org

Cameron McCormack wrote:
> Hi David.
> Cameron McCormack:
>>> [re allowing a Function to implement a callback interface]
>>> I believe this is already handled for all such interfaces, in the last
>>> paragraph of section 4.4:
> L. David Baron:
>> I'm not sure if you want it to be handled for all such interfaces.
>> You often want this behavior for interfaces that you expect will
>> always have a single method, but you may not if they currently have
>> one method but you expect more methods to be added via derived
>> interfaces (either now or potentially later).
> You can now specify [Callback], to allow either a function or a property
> on a native object to be the implementation, [Callback=FunctionOnly]
> to require it to be the function that is the implementation, and
> [Callback=PropertyOnly] to require the property on the object to be the
> implementation.
>   http://dev.w3.org/2006/webapi/WebIDL/#Callback

Why do we need the FunctionOnly/PropertyOnly feature? In gecko we don't 
have that functionality and it hasn't caused any problems that I can 
think of.

What could make sense to do is to say that if the [Callback] interface 
has any attributes or more than one function you can't pass a function.

But why would we ever want an interface that only had one function that 
we didn't want to be implementable as a function.

/ Jonas
Received on Monday, 24 November 2008 04:36:12 UTC

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