W3C home > Mailing lists > Public > public-device-apis@w3.org > June 2011

Re: BatteryStatusEvent should not be [NoInterfaceObject]

From: Anssi Kostiainen <anssi.kostiainen@nokia.com>
Date: Fri, 17 Jun 2011 14:36:46 +0300
CC: <public-device-apis@w3.org>
Message-ID: <0F8475E7-FE27-4152-9707-C7918A02BEC9@nokia.com>
To: ext Dominique Hazael-Massieux <dom@w3.org>
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 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Wednesday, 9 May 2012 00:14:21 GMT