Bug 681640 - Send mouse events to form fields when they are focused in Fennec [r=mbrubeck]
☠☠ backed out by 58185fa8b490 ☠ ☠
authorMartijn Wargers <martijn.martijn>
Wed, 31 Aug 2011 15:55:00 -0700
changeset 76497 e2807e45402c928813b001d8ec6ba4efa5b9da2b
parent 76496 3a37edcaa27fb9b3699f791414c44f9a500a5ced
child 76498 08b6eaf6aad0e7011f2287db663ab5f67404fd58
push id3
push userfelipc@gmail.com
push dateFri, 30 Sep 2011 20:09:13 +0000
reviewersmbrubeck
bugs681640
milestone9.0a1
Bug 681640 - Send mouse events to form fields when they are focused in Fennec [r=mbrubeck]
mobile/chrome/content/content.js
--- a/mobile/chrome/content/content.js
+++ b/mobile/chrome/content/content.js
@@ -490,19 +490,20 @@ let Content = {
       case "Browser:MouseClick": {
         this._formAssistant.focusSync = true;
         let element = elementFromPoint(x, y);
         if (modifiers == Ci.nsIDOMNSEvent.CONTROL_MASK) {
           let uri = Util.getHrefForElement(element);
           if (uri)
             sendAsyncMessage("Browser:OpenURI", { uri: uri,
                                                   referrer: element.ownerDocument.documentURIObject.spec });
-        } else if (!this._formAssistant.open(element) && this._highlightElement) {
-          sendAsyncMessage("FindAssist:Hide", { });
-          this._sendMouseEvent("mousemove", this._highlightElement, x, y);
+        } else if (this._highlightElement) {
+          if (!this._formAssistant.open(element))
+            sendAsyncMessage("FindAssist:Hide", { });
+          this._sendMouseEvent("mousemove", this._highlightElement, x, y); 
           this._sendMouseEvent("mousedown", this._highlightElement, x, y);
           this._sendMouseEvent("mouseup", this._highlightElement, x, y);
         }
         this._cancelTapHighlight();
         ContextHandler.reset();
         this._formAssistant.focusSync = false;
         break;
       }