Re: [vibra] Vibration API -- the first stab (was: Mozilla's WebVibrator contribution)

On 31.10.2011, at 9.14, ext Jonas Sicking wrote:

> On Fri, Oct 28, 2011 at 5:04 AM, Anssi Kostiainen
> <anssi.kostiainen@nokia.com> wrote:
>> On 28.10.2011, at 12.51, ext JOSE MANUEL CANTERA FONSECA wrote:
>> 
>>> In addition I'm missing
>>> 
>>> navigator.vibrator.cancel(vibrationRequest)
>> 
>> This is the same as one of the following:
>> 
>> vibrate(undefined)
>> vibrate()
>> vibrate(null)
>> vibrate(0)
>> vibrate([])
> 
> This seems a bit redundant. In particular, the first three seems
> unnecessary to support.

I agree, and I'd prefer to drop them too. They've been inherited from:

[[

 * We handle the argument to mozVibrate as follows.
 *
 * - If the argument is undefined, null, 0, or the empty list, we cancel any
 *   outstanding vibration pattern; that is, we stop the device from vibrating.

]]

So I assume we should just throw TypeError for undefined and null (or whatever WebIDL gives us for free)?

-Anssi

Received on Tuesday, 1 November 2011 19:06:34 UTC