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

Re: Vibration: throwing and pause

From: Justin Lebar <justin.lebar@gmail.com>
Date: Fri, 12 Apr 2013 16:57:21 -0400
Message-ID: <CAFWcpZ6tLst9PVoAuwCx5OepHrvZW7KjrNtbUbAkG+YzxZs8mg@mail.gmail.com>
To: "Kostiainen, Anssi" <anssi.kostiainen@intel.com>
Cc: Anne van Kesteren <annevk@annevk.nl>, "public-device-apis@w3.org" <public-device-apis@w3.org>
> Justin - Anne would like to see vibrate() not throw. Are you aware of any related issues with the current implementation https://bugzil.la/679966?

I'm not aware of any bugs that have been filed about us throwing, if
that's what you mean.

I kind of like the fact that we throw, since otherwise it's impossible
for developers to know if their time/pattern has exceeded the UA's
arbitrary constraints.  Although the UA does in fact have other
opportunities not to run the requested vibration, it seems useful to
me for the UA to inform the page "you've got no chance with this one."

But I don't feel strongly about this, and I'm happy to defer to Anne's

>> Also, I think the IDL should say "(unsigned long or sequence<unsigned
>> long>) pattern"
> The IDL change seems proper, and matches implementations IIUC. Justin?

I don't know how (unsigned long or sequence<unsigned long>) is different, in
practical terms, from the overloads (unsigned long) and (unsigned long[]) that
we have now.  So I probably don't have an opinion on this.  :)

>>>> Also, "pause"?! Is that intentional?
>>> This was fixed in the Editor's Draft, see "spin the event loop":
>>>  http://dev.w3.org/2009/dap/vibration/
>> So why does that spin the event loop?
> To make the vibration pattern behave as expected. Or is there a more appropriate construct for this?
>> Having this method be synchronous seems really bad.
> The method is synchronous for the sake of simplicity, for the web developer that is.

The method is definitely not intended to be synchronous in Firefox's

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.

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

Received on Friday, 12 April 2013 20:58:08 UTC

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