Bug 174300

Summary: [WK2] Ignore touch events that interrupt platform-driven momentum scrolling
Product: WebKit Reporter: Wenson Hsieh <wenson_hsieh>
Component: WebKit2Assignee: Wenson Hsieh <wenson_hsieh>
Status: RESOLVED FIXED    
Severity: Normal CC: bdakin, benjamin, buildbot, cmarcelo, commit-queue, fred.wang, jamesr, luiz, megan_gardner, simon.fraser, thorton, tonikitoo
Priority: P2 Keywords: InRadar
Version: WebKit Nightly Build   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
First pass
simon.fraser: review+
Patch for landing
none
Address post-review feedback
none
Address post-review feedback none

Description Wenson Hsieh 2017-07-09 13:44:49 PDT
In https://trac.webkit.org/r211197, we decreased the scroll deceleration rate in web content to match the rest of the iOS platform. However, due to the much longer duration of the momentum scrolling phase, many users are tapping during momentum scrolling to stop scroll deceleration -- this, in turn, leads to many unwanted or accidental taps in web content on pages such as images.google.com.

One potential way to resolve this is to prevent touches that interrupt momentum scrolling from propagating DOM touch events.
Comment 1 Wenson Hsieh 2017-07-09 13:47:19 PDT
<rdar://problem/33030639>
Comment 2 Wenson Hsieh 2017-07-09 15:54:55 PDT
Created attachment 314957 [details]
First pass
Comment 3 Simon Fraser (smfr) 2017-07-10 11:30:56 PDT
Comment on attachment 314957 [details]
First pass

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

> Source/WebKit2/UIProcess/ios/WKContentViewInteraction.mm:4058
> +// FIXME: Remove once -gestureRecognizer:shouldIgnoreWebTouchWithEvent: is in UIWebTouchEventsGestureRecognizer.h.

Would be nice to have a radar number here.

> Source/WebKit2/UIProcess/ios/WKContentViewInteraction.mm:4067
> +    NSSet<UITouch *> *webTouches = [event touchesForGestureRecognizer:gestureRecognizer];
> +    for (UITouch *webTouch in webTouches) {

I think "webTouches" and "webTouch" could just be "touches" and "touch".
Comment 4 Wenson Hsieh 2017-07-10 12:14:58 PDT
Comment on attachment 314957 [details]
First pass

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

Thanks Simon!

>> Source/WebKit2/UIProcess/ios/WKContentViewInteraction.mm:4058
>> +// FIXME: Remove once -gestureRecognizer:shouldIgnoreWebTouchWithEvent: is in UIWebTouchEventsGestureRecognizer.h.
> 
> Would be nice to have a radar number here.

👍 included a radar here.

>> Source/WebKit2/UIProcess/ios/WKContentViewInteraction.mm:4067
>> +    for (UITouch *webTouch in webTouches) {
> 
> I think "webTouches" and "webTouch" could just be "touches" and "touch".

Done.
Comment 5 Wenson Hsieh 2017-07-10 12:27:29 PDT
Created attachment 315008 [details]
Patch for landing
Comment 6 WebKit Commit Bot 2017-07-10 15:08:42 PDT
Comment on attachment 315008 [details]
Patch for landing

Clearing flags on attachment: 315008

Committed r219310: <http://trac.webkit.org/changeset/219310>
Comment 7 Wenson Hsieh 2017-07-10 21:14:39 PDT
Created attachment 315073 [details]
Address post-review feedback
Comment 8 Wenson Hsieh 2017-07-10 21:39:52 PDT
Created attachment 315076 [details]
Address post-review feedback
Comment 9 WebKit Commit Bot 2017-07-11 10:55:24 PDT
Comment on attachment 315076 [details]
Address post-review feedback

Clearing flags on attachment: 315076

Committed r219340: <http://trac.webkit.org/changeset/219340>