Bug 1031226 - [vibration] navigator.vibrate([]) fails to cancel a pre-existing instance of the processing vibration patterns algorithm, r=mounir
authorOlli Pettay <Olli.Pettay@helsinki.fi>
Thu, 10 Jul 2014 17:31:36 +0300
changeset 193393 d6a41b0f97945fa5881cc2a269ec1779241d96c2
parent 193392 df6ba75a47bdc5f1e460d9e9079f92374e776e52
child 193394 7d69a8da6ce30eb92f5f7279dddc9b7321050a34
push id7693
push userryanvm@gmail.com
push dateThu, 10 Jul 2014 22:28:27 +0000
treeherderfx-team@e1a037c085d1 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmounir
bugs1031226
milestone33.0a1
Bug 1031226 - [vibration] navigator.vibrate([]) fails to cancel a pre-existing instance of the processing vibration patterns algorithm, r=mounir
dom/base/Navigator.cpp
--- a/dom/base/Navigator.cpp
+++ b/dom/base/Navigator.cpp
@@ -804,17 +804,17 @@ Navigator::Vibrate(const nsTArray<uint32
   for (size_t i = 0; i < pattern.Length(); ++i) {
     if (pattern[i] > sMaxVibrateMS) {
       pattern[i] = sMaxVibrateMS;
     }
   }
 
   // The spec says we check sVibratorEnabled after we've done the sanity
   // checking on the pattern.
-  if (pattern.IsEmpty() || !sVibratorEnabled) {
+  if (!sVibratorEnabled) {
     return true;
   }
 
   // Add a listener to cancel the vibration if the document becomes hidden,
   // and remove the old visibility listener, if there was one.
 
   if (!gVibrateWindowListener) {
     // If gVibrateWindowListener is null, this is the first time we've vibrated,