Bug 130441 - WebKit2 View Gestures: Swipe gesture can track vertical movement instead of horizontal movement
Summary: WebKit2 View Gestures: Swipe gesture can track vertical movement instead of h...
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebKit2 (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Tim Horton
Keywords: InRadar
Depends on:
Reported: 2014-03-18 19:25 PDT by Tim Horton
Modified: 2014-03-19 10:57 PDT (History)
3 users (show)

See Also:

patch (4.16 KB, patch)
2014-03-18 19:35 PDT, Tim Horton
no flags Details | Formatted Diff | Diff
patch that builds (4.08 KB, patch)
2014-03-18 20:46 PDT, Tim Horton
simon.fraser: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Tim Horton 2014-03-18 19:25:36 PDT
ViewGestureController::handleScrollWheelEvent properly bails in a wide variety of cases, but wheelEventWasNotHandledByWebCore does not, so we can pick up a wheel event that was rejected by the web process (and would have been rejected by the checks in handleScrollWheelEvent) and use it to start tracking a swipe.

One of the cases we check in handleScrollWheelEvent is that the horizontal delta is bigger; since we don't check this in wheelEventWasNotHandledByWebCore, we can start tracking a swipe from an event with a predominantly vertical delta, which results in the swipe tracking vertical movement instead of horizontal movement.

We should factor out all of the cases and check in both places.

Comment 1 Tim Horton 2014-03-18 19:35:37 PDT
Created attachment 227147 [details]
Comment 2 Tim Horton 2014-03-18 20:46:58 PDT
Created attachment 227152 [details]
patch that builds
Comment 3 Simon Fraser (smfr) 2014-03-19 10:45:15 PDT
Comment on attachment 227152 [details]
patch that builds

View in context: https://bugs.webkit.org/attachment.cgi?id=227152&action=review

> Source/WebKit2/UIProcess/mac/ViewGestureControllerMac.mm:267
>      if (!event.hasPreciseScrollingDeltas)
>          return false;
>      if (![NSEvent isSwipeTrackingFromScrollEventsEnabled])
>          return false;

Would be cheaper to do these early returns sooner.

> Source/WebKit2/UIProcess/mac/ViewGestureControllerMac.mm:279
> +    m_hasPendingSwipe = false;

Does this need to be cleared before the previous return?
Comment 4 Tim Horton 2014-03-19 10:57:45 PDT