W3C home > Mailing lists > Public > public-device-apis@w3.org > April 2013

Re: Vibration: throwing and pause

From: Kostiainen, Anssi <anssi.kostiainen@intel.com>
Date: Mon, 15 Apr 2013 21:14:46 +0000
To: Anne van Kesteren <annevk@annevk.nl>, Justin Lebar <justin.lebar@gmail.com>, "public-device-apis@w3.org" <public-device-apis@w3.org>
Message-ID: <E9625C47-C555-4891-AFC1-099595579AC4@intel.com>
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?

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

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