Bug 675126 - Logic error in AddWindowListener which prevents all window listeners from being added r=dougt
authorDoug Turner <dougt@dougt.org>
Thu, 28 Jul 2011 20:26:20 -0700
changeset 73502 bc1a1ecbb82e620f31e3e7dedd3b1d78bf951565
parent 73501 372138c61ddbe93281bc309939f80e01293940d3
child 73503 5bd0acd3230871f83f199c555ee050d854ea9f32
push idunknown
push userunknown
push dateunknown
reviewersdougt
bugs675126
milestone8.0a1
Bug 675126 - Logic error in AddWindowListener which prevents all window listeners from being added r=dougt
dom/system/nsDeviceMotion.cpp
--- a/dom/system/nsDeviceMotion.cpp
+++ b/dom/system/nsDeviceMotion.cpp
@@ -197,17 +197,17 @@ NS_IMETHODIMP nsDeviceMotion::RemoveList
 }
 
 NS_IMETHODIMP nsDeviceMotion::AddWindowListener(nsIDOMWindow *aWindow)
 {
   if (mStarted == PR_FALSE) {
     mStarted = PR_TRUE;
     Startup();
   }
-  if (mWindowListeners.IndexOf(aWindow) != NoIndex)
+  if (mWindowListeners.IndexOf(aWindow) == NoIndex)
     mWindowListeners.AppendElement(aWindow);
   return NS_OK;
 }
 
 NS_IMETHODIMP nsDeviceMotion::RemoveWindowListener(nsIDOMWindow *aWindow)
 {
   if (mWindowListeners.IndexOf(aWindow) != NoIndex)
     return NS_OK;