Bug 681640 - Tapping on a form field in Fennec should position the caret at the location of the tap [r=mfinkle]
authorMatt Brubeck <mbrubeck@mozilla.com>
Sun, 04 Sep 2011 08:06:07 -0700
changeset 76527 44e3478debec190603edeb0c0d2fc1b4228d4a7d
parent 76522 d09cbf88c277e359162dcf2c93cf27f69113c1fb
child 76528 e23d05fcd782220b8c32cdd2db2822bb52a330c2
push id3
push userfelipc@gmail.com
push dateFri, 30 Sep 2011 20:09:13 +0000
reviewersmfinkle
bugs681640
milestone9.0a1
Bug 681640 - Tapping on a form field in Fennec should position the caret at the location of the tap [r=mfinkle]
mobile/chrome/content/content.js
--- a/mobile/chrome/content/content.js
+++ b/mobile/chrome/content/content.js
@@ -490,18 +490,23 @@ 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) {
+          break;
+        }
+
+        if (!this._formAssistant.open(element))
           sendAsyncMessage("FindAssist:Hide", { });
+
+        if (this._highlightElement) {
           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;