Re: Vibration: throwing and pause

On Apr 13, 2013, at 11:24 AM, Anne van Kesteren <annevk@annevk.nl> wrote:

>> The method is definitely not intended to be synchronous in Firefox's
>> implementation.
>> 
>> I don't even know what it means to synchronously do an operation like this.
>> Obviously the vibrate() call doesn't block until the phone starts
>> moving, or something like that.

I tried to say that from the developer's point of view the method works as "fire and forget". An implementation surely should be asynchronous.

>> Could you elaborate on how making this method sync and spinning the event loop
>> impacts content authors?  I agree with Anne that making this sync seems Very
>> Bad.
> 
> Yeah, it should simply return early and then asynchronously do the
> vibration bits.


A proposal:

* IDL change: vibrate() returns boolean.
* In steps 3 and 5 return false instead of throwing.
* In steps 6, 7 and 9 return false instead of aborting.
* Between current steps 9 and 10 return true.
* In step 10 say "run the following substeps asynchronously".

Would that work for you? Any bugs?

-Anssi

Received on Monday, 15 April 2013 21:15:17 UTC