W3C home > Mailing lists > Public > public-device-apis@w3.org > November 2011

Preliminary thoughts on the vibrator spec

From: Justin Lebar <jlebar@mozilla.com>
Date: Thu, 3 Nov 2011 18:35:10 -0400
Message-ID: <CAFWcpZ5Bu9M4EYWKAY_53KVkCO9G5A+TOeuzfbddniWsVpcuDA@mail.gmail.com>
To: public-device-apis@w3.org
At the meeting today I said I'd send out some thoughts on the vibrator
spec after reading it.  Here they are.

Section 3.1 says no exceptions for vibrate, but it may throw NotSupportedError.

I don't think you need the |already started| flag.  It guards
cancellations of the algorithm, but you can just unconditionally
"cancel the pre-existing instance of the processing vibration
algorithm, if any".

Need to indicate that if the device doesn't have a vibrator, or the
user has disabled the vibrator (globally, or for this page), we
silently ignore the vibration request.

Algorithm step 2: If a page is hidden and calls vibrate(...), why do
we cancel other instances of the algorithm?

Algorithm step 5: "If pattern is 0 or an empty list, cancel the
pre-existing attempt, if any,"  What does it mean to cancel the
pre-existing attempt?  Is that the same as canceling the pre-existing
instance of the processing vibration patterns algorithm?  If this is
annoying to type, let's declare a more concise synonym.

Algorithm step 5: "If pattern is 0, an empty list," **null, or undefined**

Algorithm step 7: Throw if any entry is not a non-negative number.
Algorithm steps 8, 10: Can we use "even" instead of "divides by 2
leaving no remainder"?  If you don't want to rely on the fact that 0
is even, you can always test for oddness.

Received on Friday, 4 November 2011 16:21:52 UTC

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