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

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