Bug 989769: Allow for vertical scrolls to interrupt horizontal swipes on OSX. r=smichaud
authorStephen Pohl <spohl.mozilla.bugs@gmail.com>
Wed, 07 May 2014 19:53:01 -0400
changeset 182012 9641ef44e561f974a9b888349a7770d3d3afc1cb
parent 182011 3b5fb4abaa3fe006cbcc34fa0bfcb940b1101c53
child 182013 64c3eff5064a1806d705bf6c3be819f7b0dd3ba6
push id43195
push userspohl@mozilla.com
push dateWed, 07 May 2014 23:53:14 +0000
treeherdermozilla-inbound@9641ef44e561 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerssmichaud
bugs989769
milestone32.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 989769: Allow for vertical scrolls to interrupt horizontal swipes on OSX. r=smichaud
widget/cocoa/nsChildView.mm
--- a/widget/cocoa/nsChildView.mm
+++ b/widget/cocoa/nsChildView.mm
@@ -5021,33 +5021,22 @@ static int32_t RoundUp(double aDouble)
     return;
   }
 
   NPCocoaEvent cocoaEvent;
   ChildViewMouseTracker::AttachPluginEvent(wheelEvent, self, theEvent,
                                            NPCocoaEventScrollWheel,
                                            &cocoaEvent);
 
+  mGeckoChild->DispatchWindowEvent(wheelEvent);
+  if (!mGeckoChild) {
+    return;
+  }
+
 #ifdef __LP64__
-  // Only dispatch this event if we're not currently tracking a scroll event as
-  // swipe.
-  if (!mCancelSwipeAnimation || *mCancelSwipeAnimation == YES) {
-#endif // #ifdef __LP64__
-    mGeckoChild->DispatchWindowEvent(wheelEvent);
-    if (!mGeckoChild) {
-      return;
-    }
-#ifdef __LP64__
-  } else {
-    // Manually set these members here since we didn't dispatch the event.
-    wheelEvent.overflowDeltaX = wheelEvent.deltaX;
-    wheelEvent.overflowDeltaY = wheelEvent.deltaY;
-    wheelEvent.mViewPortIsOverscrolled = true;
-  }
-
   // overflowDeltaX and overflowDeltaY tell us when the user has tried to
   // scroll past the edge of a page (in those cases it's non-zero).
   if ((wheelEvent.deltaMode == nsIDOMWheelEvent::DOM_DELTA_PIXEL) &&
       (wheelEvent.deltaX != 0.0 || wheelEvent.deltaY != 0.0)) {
     [self maybeTrackScrollEventAsSwipe:theEvent
                        scrollOverflowX:wheelEvent.overflowDeltaX
                        scrollOverflowY:wheelEvent.overflowDeltaY
                 viewPortIsOverscrolled:wheelEvent.mViewPortIsOverscrolled];