Bug 886584 - Enable scrolling/pan on start-ui from tiles. r=fryn
authorSam Foster <sfoster@mozilla.com>
Mon, 01 Jul 2013 16:00:51 -0700
changeset 137076 077d1f98d00f355b67a5f04ab9c0296d19b22e2f
parent 137075 ea3f2bc8bc1ee6f64f0aff5fbd7c5d6c33908227
child 137077 40a51c5dca9e46c6db13ce6c802e1b10cca20dc8
push id24909
push userkhuey@mozilla.com
push dateTue, 02 Jul 2013 16:45:38 +0000
treeherdermozilla-central@23ce4eab8fb1 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersfryn
bugs886584
milestone25.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 886584 - Enable scrolling/pan on start-ui from tiles. r=fryn
browser/metro/modules/CrossSlide.jsm
--- a/browser/metro/modules/CrossSlide.jsm
+++ b/browser/metro/modules/CrossSlide.jsm
@@ -156,34 +156,31 @@ CrossSlideHandler.prototype = {
     let touch = aEvent.touches[0];
      // cross-slide is a single touch gesture
      // the top target is the one we need here, touch.target not relevant
     let target = aEvent.target;
 
     if (!isSelectable(target))
         return;
 
-    // we'll handle this event, dont let it bubble further
-    aEvent.stopPropagation();
-
     let scrollAxis = getScrollAxisFromElement(target);
 
     this.drag = {
       scrollAxis: scrollAxis,
       crossAxis: (scrollAxis=='x') ? 'y' : 'x',
       origin: pointFromTouchEvent(aEvent),
       state: -1
     };
   },
 
   _onTouchMove: function(aEvent){
     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(aEvent);
     }
 
     let startPt = this.drag.origin;
@@ -201,16 +198,17 @@ CrossSlideHandler.prototype = {
     let newState = this.getCrossSlideState(crossAxisDistance, scrollAxisDistance);
 
     if (-1 == newState) {
       // out of bounds, cancel the event always
       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(aEvent);
@@ -223,19 +221,16 @@ CrossSlideHandler.prototype = {
 
     this.drag.state = newState;
     this._fireProgressEvent( CrossSlidingStateNames[newState], aEvent );
   },
   _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(aEvent);
     }
 
     this._fireProgressEvent("completed", aEvent);
     this._fireSelectEvent(aEvent);
     this.drag = null;
   },