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

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