Preliminary thoughts on the vibrator spec

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.

Regards
-Justin

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