Bug 174300 - [WK2] Ignore touch events that interrupt platform-driven momentum scrolling
Summary: [WK2] Ignore touch events that interrupt platform-driven momentum scrolling
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebKit2 (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Wenson Hsieh
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2017-07-09 13:44 PDT by Wenson Hsieh
Modified: 2017-07-27 02:17 PDT (History)
12 users (show)

See Also:


Attachments
First pass (32.73 KB, patch)
2017-07-09 15:54 PDT, Wenson Hsieh
simon.fraser: review+
Details | Formatted Diff | Diff
Patch for landing (32.84 KB, patch)
2017-07-10 12:27 PDT, Wenson Hsieh
no flags Details | Formatted Diff | Diff
Address post-review feedback (17.17 KB, patch)
2017-07-10 21:14 PDT, Wenson Hsieh
no flags Details | Formatted Diff | Diff
Address post-review feedback (16.37 KB, patch)
2017-07-10 21:39 PDT, Wenson Hsieh
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
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>