[Pkg-mozext-commits] [firegestures] 04/13: [e10s] cancel gesture with left-button on form elements

David Prévot taffit at moszumanska.debian.org
Thu Jan 1 18:34:25 UTC 2015


This is an automated email from the git hooks/post-receive script.

taffit pushed a commit to branch master
in repository firegestures.

commit 286f09629e22ce4dc532c560b8a8c6d4ca5a5135
Author: Gomita <gomita at xuldev.org>
Date:   Sat Dec 27 17:27:41 2014 +0900

    [e10s] cancel gesture with left-button on form elements
---
 FireGestures.idl                       |   5 +++++
 chrome/content/firegestures/browser.js |   3 +++
 chrome/content/firegestures/remote.js  |   9 +++++++--
 components/FireGestures.xpt            | Bin 1449 -> 1476 bytes
 components/xdGestureHandler.js         |   5 +++++
 5 files changed, 20 insertions(+), 2 deletions(-)

diff --git a/FireGestures.idl b/FireGestures.idl
index 47963b5..d37381f 100644
--- a/FireGestures.idl
+++ b/FireGestures.idl
@@ -102,6 +102,11 @@ interface xdIGestureHandler : nsISupports
 	 */
 	void openPopupAtPointer(in nsIDOMElement aPopup);
 
+	/**
+	 * Cancel mouse gesture forcibly
+	 */
+	void cancelMouseGesture();
+
 };
 
 
diff --git a/chrome/content/firegestures/browser.js b/chrome/content/firegestures/browser.js
index 7ac403a..5e79d8f 100644
--- a/chrome/content/firegestures/browser.js
+++ b/chrome/content/firegestures/browser.js
@@ -88,6 +88,9 @@ var FireGestures = {
 			case "linkURLs": 
 				this._linkURLs = aMsg.data.linkURLs;
 				break;
+			case "cancelMouseGesture": 
+				this._gestureHandler.cancelMouseGesture();
+				break;
 			default: 
 		}
 	},
diff --git a/chrome/content/firegestures/remote.js b/chrome/content/firegestures/remote.js
index 077cca6..57b4229 100644
--- a/chrome/content/firegestures/remote.js
+++ b/chrome/content/firegestures/remote.js
@@ -60,8 +60,13 @@ let FireGesturesRemote = {
 		this._startY = aData.y;
 		let { doc: doc, elt: elt } = this._elementFromPoint(aData.x, aData.y);
 		if (aData.button == 0) {
-			// [ToDo] get the element under mouse pointer with the use of document.elementFromPoint
-			// if the element is scrollbar, cancel starting gesture
+			// cancel starting gesture on form elements
+			let localName = elt.localName;
+			if (["input", "textarea", "select", "option", "textbox", "menulist"].indexOf(localName) >= 0) {
+				log("*** cancel starting gesture on form element (" + localName + ")");	// #debug
+				sendSyncMessage("FireGesturesRemote:Response", { name: "cancelMouseGesture" }, {});
+				return;
+			}
 			// select event should be cancelled
 		}
 		// tell parent browser the source node and some info
diff --git a/components/FireGestures.xpt b/components/FireGestures.xpt
index 3e4b033..83d3587 100644
Binary files a/components/FireGestures.xpt and b/components/FireGestures.xpt differ
diff --git a/components/xdGestureHandler.js b/components/xdGestureHandler.js
index ce6b218..a3f51c7 100644
--- a/components/xdGestureHandler.js
+++ b/components/xdGestureHandler.js
@@ -662,6 +662,11 @@ xdGestureHandler.prototype = {
 		this._stopGesture();
 	},
 
+	cancelMouseGesture: function FGH_cancelMouseGesture() {
+		this._directionChain = "";
+		this._stopGesture();
+	},
+
 
 	/* ::::: MOUSE TRAIL ::::: */
 

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-mozext/firegestures.git



More information about the Pkg-mozext-commits mailing list