[Pkg-mozext-commits] [firegestures] 04/07: Imported Upstream version 1.9~b3
David Prévot
taffit at moszumanska.debian.org
Sun Jan 11 16:59:17 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 efe15da0a9fc6fa42e5d91ece8de6ae2af43dab2
Merge: 81a172f 4042076
Author: David Prévot <david at tilapin.org>
Date: Sun Jan 11 11:40:42 2015 -0400
Imported Upstream version 1.9~b3
chrome/content/firegestures/browser.js | 4 ++++
chrome/content/firegestures/remote.js | 23 ++++++++++-------------
components/xdGestureHandler.js | 24 ++++++++++++++----------
install.rdf | 2 +-
4 files changed, 29 insertions(+), 24 deletions(-)
diff --cc chrome/content/firegestures/browser.js
index 6ae8f14,e2645ab..46687d7
mode 100755,100644..100755
--- a/chrome/content/firegestures/browser.js
+++ b/chrome/content/firegestures/browser.js
diff --cc chrome/content/firegestures/remote.js
index 2a50985,2e8379c..edb62d2
mode 100755,100644..100755
--- a/chrome/content/firegestures/remote.js
+++ b/chrome/content/firegestures/remote.js
@@@ -44,9 -58,12 +46,9 @@@ let FireGesturesRemote =
this._startX = aData.x;
this._startY = aData.y;
let { doc: doc, elt: elt } = this._elementFromPoint(aData.x, aData.y);
- if (aData.button == 0) {
+ if (aData.type != "MozSwipeGesture" && aData.button == 0) {
- // 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;
}
@@@ -60,6 -79,14 +62,12 @@@
sendSyncMessage("FireGesturesRemote:Response", { name: "sourceNode" }, { elt: elt });
},
+ _onSwipeGesture: function(aData) {
- log("onSwipeGesture: " + aData.toSource()); // #debug
+ let { elt: elt } = this._elementFromPoint(aData.x, aData.y);
+ sendSyncMessage("FireGesturesRemote:Response", { name: "sourceNode" }, { elt: elt });
+ sendSyncMessage("FireGesturesRemote:Response", { name: "swipe" }, { direction: aData.direction });
+ },
+
handleEvent: function(event) {
switch (event.type) {
case "scroll":
@@@ -143,18 -176,9 +151,7 @@@
},
- /* ::::: Utils ::::: */
- //
- // _elementAtPointer: function FGR__elementAtPointer() {
- // let doc = content.document;
- // let elt = doc.querySelector(":hover") || doc.body || doc.documentElement;
- // while (/^i?frame$/.test(elt.localName.toLowerCase())) {
- // doc = elt.contentDocument;
- // elt = doc.querySelector(":hover");
- // }
- // return elt;
- // },
-
- // returns DOM element and some data related which is located at given coordinates
_elementFromPoint: function FGR__elementFromPoint(x, y) {
let doc = content.document;
let elt = doc.elementFromPoint(x, y) || doc.body || doc.documentElement;
@@@ -164,7 -188,8 +161,7 @@@
doc = elt.contentDocument;
elt = doc.elementFromPoint(x, y);
}
- return { doc: doc, elt: elt, x: x, y: y };
- // log("_elementFromPoint: " + [doc.location, elt.localName, x, y].join(", ")); // #debug
+ return { doc: doc, elt: elt };
},
diff --cc components/xdGestureHandler.js
index ecb4b7d,6cdaa19..97938d6
mode 100755,100644..100755
--- a/components/xdGestureHandler.js
+++ b/components/xdGestureHandler.js
@@@ -299,9 -385,17 +299,16 @@@ xdGestureHandler.prototype =
case event.DIRECTION_UP : direction = "up"; break;
case event.DIRECTION_DOWN : direction = "down"; break;
}
+ this._isRemote = this._drawArea.mCurrentBrowser.getAttribute("remote") == "true";
- // [e10s] get source node and invoke extra gesture in remote
+ if (this._isRemote) {
+ this._gestureObserver.sendAsyncMessage("FireGestures:SwipeGesture", {
+ direction: direction,
+ x: event.screenX - this._drawArea.mCurrentBrowser.boxObject.screenX,
+ y: event.screenY - this._drawArea.mCurrentBrowser.boxObject.screenY,
+ });
+ return;
+ }
this.sourceNode = event.target;
- this._lastX = event.screenX;
- this._lastY = event.screenY;
this._invokeExtraGesture(event, "swipe-" + direction);
this.sourceNode = null;
return;
@@@ -370,10 -481,13 +375,11 @@@
this._lastY = event.screenY;
this._directionChain = "";
this._shouldFireContext = false;
- if (this._trailEnabled)
- // trail drawing
+ if (!this._swipeTimer && this._trailEnabled)
this.createTrail(event);
- // [e10s] tell remote browser that mouse gesture has started
if (this._isRemote) {
this._gestureObserver.sendAsyncMessage("FireGestures:GestureStart", {
+ type: event.type,
button: event.button,
x: event.screenX - this._drawArea.mCurrentBrowser.boxObject.screenX,
y: event.screenY - this._drawArea.mCurrentBrowser.boxObject.screenY,
@@@ -433,10 -562,14 +439,10 @@@
this._isMouseDownM = false;
this._isMouseDownR = false;
this._clearTimeout();
- if (this._trailEnabled)
- // clear trail drawing
+ if (!this._swipeTimer && this._trailEnabled)
this.eraseTrail();
- // don't call onMouseGesture after events sequence: mousedown > minimal mousemove > mouseup
if (this._directionChain) {
this._gestureObserver.onMouseGesture(event, this._directionChain);
- // suppress immediate context menu after finishing mouse gesture with right-button
- // don't suppress mouse gesture with left or middle button
this._suppressContext = true;
this._shouldFireContext = false;
}
--
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