W3C home > Mailing lists > Public > public-device-apis@w3.org > September 2012

Re: [vibra] Adding [NoInterfaceObject] to the Vibration interface

From: Marcos Caceres <w3c@marcosc.com>
Date: Wed, 5 Sep 2012 10:14:14 +0100
To: Anssi Kostiainen <anssi.kostiainen@nokia.com>
Cc: "public-device-apis@w3.org public-device-apis@w3.org" <public-device-apis@w3.org>, ext Justin Lebar <jlebar@mozilla.com>, 권기홍 Kwon <kihong.kwon@samsung.com>
Message-ID: <1F5214995A5543CB8736F501A10C2737@marcosc.com>

On Wednesday, September 5, 2012 at 9:47 AM, Anssi Kostiainen wrote:

> Hi All, Justin, Kihong,
> I noticed none of the known implementations [1] expose Vibration interface in the global context, so I updated the Vibration API Editor's Draft [2] to match the implementations. I.e. I added [NoInterfaceObject] to the Vibration interface as follows:
> Navigator implements Vibration;
> [NoInterfaceObject]
> interface Vibration {
> void vibrate (unsigned long time);
> void vibrate (unsigned long[] pattern);
> };
> This change does not break feature detection as the usual pattern can still be used:
> if (typeof navigator.vibrate === 'function') {
> console.log('Vibration API supported');
> }
> Let me know if there are concerns with this change.
Is there some valid reason why Vibration is not being exposed? I'm concerned about jumping the gun on adding [NoInterfaceObject] without understanding why implementers are not following the spec/WebIDL here. As it says in WebIDL, "The [NoInterfaceObject] extended attribute should not be used on interfaces that are not solely used as supplemental interfaces, unless there are clear Web compatibility reasons for doing so." 

We should add [NoInterfaceObject] only once we know what the "clear Web compatibility reasons" are (if any). Otherwise, checking for the Vibration host object should be the first test in the test suite.    

Marcos Caceres
Received on Wednesday, 5 September 2012 09:15:03 UTC

This archive was generated by hypermail 2.3.1 : Monday, 23 October 2017 14:53:55 UTC