Bug 864706 - Fix calls to CrossSlide.Handle's cancel to provide event param. r=jimm
authorSam Foster <sfoster@mozilla.com>
Tue, 23 Apr 2013 16:13:51 +0100
changeset 129614 aa0d00ea2c5f660f3fb3bdbe9244ba474fee8d83
parent 129613 61711e1aab0cb1ff2d066682ec35c1e534787927
child 129615 bd3be96f70fe63f4955540884f124320e85bf5d1
push id26919
push usersfoster@mozilla.com
push dateTue, 23 Apr 2013 15:14:53 +0000
treeherdermozilla-inbound@aa0d00ea2c5f [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjimm
bugs864706
milestone23.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 864706 - Fix calls to CrossSlide.Handle's cancel to provide event param. r=jimm
browser/metro/modules/CrossSlide.jsm
--- a/browser/metro/modules/CrossSlide.jsm
+++ b/browser/metro/modules/CrossSlide.jsm
@@ -140,17 +140,17 @@ CrossSlideHandler.prototype = {
         this._onTouchMove(aEvent);
         break;
       case "touchend":
         this._onTouchEnd(aEvent);
         break;
     }
   },
 
-  cancel: function(){
+  cancel: function(aEvent){
     this._fireProgressEvent("cancelled", aEvent);
     this.drag = null;
   },
 
   _onTouchStart: function onTouchStart(aEvent){
     if (aEvent.touches.length > 1)
       return;
     let touch = aEvent.touches[0];
@@ -178,17 +178,17 @@ CrossSlideHandler.prototype = {
     if (!this.drag) {
       return;
     }
     // event is handled here, dont let it bubble further
     aEvent.stopPropagation();
 
     if (aEvent.touches.length!==1) {
       // cancel if another touch point gets involved
-      return this.cancel();
+      return this.cancel(aEvent);
     }
 
     let startPt = this.drag.origin;
     let endPt = this.drag.position = pointFromTouchEvent(aEvent);
 
     let scrollAxis = this.drag.scrollAxis,
         crossAxis = this.drag.crossAxis;
 
@@ -197,28 +197,28 @@ CrossSlideHandler.prototype = {
     // distance along the scrolling axis
     let scrollAxisDistance = Math.abs(endPt[scrollAxis] - startPt[scrollAxis]);
 
     let currState = this.drag.state;
     let newState = this.getCrossSlideState(crossAxisDistance, scrollAxisDistance);
 
     if (-1 == newState) {
       // out of bounds, cancel the event always
-      return this.cancel();
+      return this.cancel(aEvent);
     }
 
     let isWithinCone = withinCone(crossAxisDistance, scrollAxisDistance);
     if (currState < CrossSlidingState.SELECTING && !isWithinCone) {
       // ignore, no progress to report
       return;
     }
     if (currState >= CrossSlidingState.SELECTING && !isWithinCone) {
       // we're committed to a cross-slide gesture,
       // so going out of bounds at this point means aborting
-      return this.cancel();
+      return this.cancel(aEvent);
     }
 
     if (currState > newState) {
       // moved backwards, ignoring
       return;
     }
 
     this.drag.state = newState;
@@ -227,17 +227,17 @@ CrossSlideHandler.prototype = {
   _onTouchEnd: function(aEvent){
     if (!this.drag)
       return;
 
     // event is handled, dont let it bubble further
     aEvent.stopPropagation();
 
     if (this.drag.state < CrossSlidingState.SELECTING) {
-      return this.cancel();
+      return this.cancel(aEvent);
     }
 
     this._fireProgressEvent("completed", aEvent);
     this._fireSelectEvent(aEvent);
     this.drag = null;
   },
 
   /**