Re: [TreatNonCallableAsNull] alternative?

On Wed, 07 Mar 2012 00:50:22 +0100, Cameron McCormack <cam@mcc.id.au>  
wrote:
> Consistency among event handler attributes?  That's my preference too.  
> But not Boris'.

He seems convinced now.


> Anyway, the strongest objection I have in this issue is against the use  
> of [TreatNonCallableAsNull] for things other than event handler  
> attributes.  My opinion on whether [TreatNonCallableAsNull] should be  
> used only for specific event handler attributes or for all of them is a  
> weak one.

The point I am making is that by having [TreatNonCallableAsNull] at all  
you introduce the possibility of it being used for other things. If  
instead you only defined the only thing for which it will ever be used,  
namely "[TreatNonCallableAsNull] attribute Function?" -> "eventhandler"  
you avoid that possibility. Given that you do not actually define event  
handler attributes I don't think it's a layering violation. It's just a  
special type of callback that happens to be extremely common in the  
platform of which the semantics of the members that use it are defined in  
HTML (or by reference to the event handler attribute concept in HTML).

Web IDL defines "eventhandler" as special callback. HTML defines "event  
handler attribute" (which has some other legacy baggage besides IDL  
syntax) so we can introduce "on..." members throughout the platform.


> I don't see what's so bad about the one-time typedef.  Typedefs exist to  
> avoid repetition like that!

The point is more that it would be the only place where  
[TreatNonCallableAsNull] would ever be used. That seems silly.


-- 
Anne van Kesteren
http://annevankesteren.nl/

Received on Wednesday, 7 March 2012 15:57:25 UTC