Bug 398143 - Dragging scrollbar with mouse while autocomplete input has focus triggers autocomplete, r=mano, a=mconnor
authormartijn.martijn@gmail.com
Tue, 02 Oct 2007 07:50:51 -0700
changeset 6537 63e8f57c7f45cc4e234f06882e9c463982312081
parent 6536 a898fb4991b2d10265fe8dba6f9d324f7d95eccc
child 6538 20485b6fa8c8e8055a89ff5e933905e8aae90c78
push idunknown
push userunknown
push dateunknown
reviewersmano, mconnor
bugs398143
milestone1.9a9pre
Bug 398143 - Dragging scrollbar with mouse while autocomplete input has focus triggers autocomplete, r=mano, a=mconnor
toolkit/components/satchel/src/nsFormFillController.cpp
--- a/toolkit/components/satchel/src/nsFormFillController.cpp
+++ b/toolkit/components/satchel/src/nsFormFillController.cpp
@@ -786,16 +786,22 @@ nsFormFillController::MouseDown(nsIDOMEv
 {
   if (!mFocusedInput)
     return NS_OK;
 
   nsCOMPtr<nsIDOMMouseEvent> mouseEvent(do_QueryInterface(aMouseEvent));
   if (!mouseEvent)
     return NS_ERROR_FAILURE;
 
+  nsCOMPtr<nsIDOMEventTarget> target;
+  aMouseEvent->GetTarget(getter_AddRefs(target));
+  nsCOMPtr<nsIDOMHTMLInputElement> targetInput = do_QueryInterface(target);
+  if (!targetInput)
+    return NS_OK;
+
   PRUint16 button;
   mouseEvent->GetButton(&button);
   if (button != 0)
     return NS_OK;
 
   PRBool isOpen = PR_FALSE;
   GetPopupOpen(&isOpen);
   if (isOpen)