Re: BatteryStatusEvent should not be [NoInterfaceObject]

Hi,

On 16.6.2011, at 18.58, ext Dominique Hazael-Massieux wrote:

> Hi Anssi,
> 
> As far as I know, events interfaces are expected to have their interface
> object exposed; at least that's the case of most events interfaces I
> know of. Was there any specific reason behind specifying
> [NoInterfaceObject] for BatteryStatusEvent?

Good catch. I had no specific reason, I just did not think about this way of doing feature detection. Now that you brought this up, I also see other events expose their interfaces on the global object, so it's certainly good to be aligned with others. I've updated the draft accordingly i.e. removed the [NoInterfaceObject] extended attribute from the BatteryStatusEvent interface.

> (I'm not actually sure why it is so; maybe so that you can do feature
> detection to determine whether a given browser supports a given type of
> event?)

It seems e.g. Modernizr does feature detection for events by testing for on* handler existence. It may well be not all implementations expose event interfaces as per the spec(s) so that's the only way to do make it work with all the current implementations.

-Anssi

Received on Friday, 17 June 2011 11:34:10 UTC