Bug 1031226 - [vibration] navigator.vibrate([]) fails to cancel a pre-existing instance of the processing vibration patterns algorithm, r=mounir
--- 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,