Bug 204748

Summary: [iOS] Introduce a gesture recognizer that can be used to defer recognition of other gestures
Product: WebKit Reporter: Wenson Hsieh <wenson_hsieh>
Component: UI EventsAssignee: Wenson Hsieh <wenson_hsieh>
Status: RESOLVED FIXED    
Severity: Normal CC: bdakin, commit-queue, dino, megan_gardner, thorton, webkit-bug-importer
Priority: P2 Keywords: InRadar
Version: WebKit Nightly Build   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
Patch
thorton: review+
Address comments
none
Address comments none

Description Wenson Hsieh 2019-12-02 08:09:56 PST
Work towards webkit.org/b/204664.
Comment 1 Wenson Hsieh 2019-12-02 08:51:22 PST
<rdar://problem/38670692>
Comment 2 Wenson Hsieh 2019-12-02 08:58:19 PST
Created attachment 384628 [details]
Patch
Comment 3 Tim Horton 2019-12-02 09:35:41 PST
Comment on attachment 384628 [details]
Patch

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

> Source/WebKit/ChangeLog:25
> +        gesture from connecting the entire gesture subgraph under WKWebView through failure depencies. This would result

sp depencies

> Source/WebKit/UIProcess/ios/WKContentViewInteraction.h:209
> +    RetainPtr<WKDeferringGestureRecognizer> _touchEventDeferringGestureRecognizerForImmediatelyResettableGestures;
> +    RetainPtr<WKDeferringGestureRecognizer> _touchEventDeferringGestureRecognizerForDelayedResettableGestures;

Are these "touch-event-deferring" (that's how I read it)? Don't they defer many things /pending/ touch event reply?

> Source/WebKit/UIProcess/ios/WKDeferringGestureRecognizer.h:36
> +- (instancetype)initWithView:(WKContentView *)view;

In an ideally-generic world this would probably be 

- (instancetype)initWithView:(UIView *)view delegate:(id <WKDeferringGestureRecognizerDelegate>)delegate;

And not know anything about WKContentView.

Does that make it any more useful? It does seem like it could be useful outside of WKContentView.
Comment 4 Wenson Hsieh 2019-12-02 09:45:12 PST
Comment on attachment 384628 [details]
Patch

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

Thanks for taking a look!

>> Source/WebKit/ChangeLog:25
>> +        gesture from connecting the entire gesture subgraph under WKWebView through failure depencies. This would result
> 
> sp depencies

oops! fixed.

>> Source/WebKit/UIProcess/ios/WKContentViewInteraction.h:209
>> +    RetainPtr<WKDeferringGestureRecognizer> _touchEventDeferringGestureRecognizerForDelayedResettableGestures;
> 
> Are these "touch-event-deferring" (that's how I read it)? Don't they defer many things /pending/ touch event reply?

That’s true. Maybe these should just be _deferringGestureRecognizerForImmediatelyResettableGestures and _deferringGestureRecognizerForDelayedResettableGestures (would make the names a little bit less of a mouthful as well).

>> Source/WebKit/UIProcess/ios/WKDeferringGestureRecognizer.h:36
>> +- (instancetype)initWithView:(WKContentView *)view;
> 
> In an ideally-generic world this would probably be 
> 
> - (instancetype)initWithView:(UIView *)view delegate:(id <WKDeferringGestureRecognizerDelegate>)delegate;
> 
> And not know anything about WKContentView.
> 
> Does that make it any more useful? It does seem like it could be useful outside of WKContentView.

While I don’t foresee any use outside of WKContentView, it wouldn’t hurt to architect it this way from the get-go; I’ll change it to be delegate-based instead of directly talking to the content view.
Comment 5 Wenson Hsieh 2019-12-02 10:01:42 PST Comment hidden (obsolete)
Comment 6 Wenson Hsieh 2019-12-02 10:10:30 PST
Created attachment 384637 [details]
Address comments
Comment 7 Wenson Hsieh 2019-12-02 11:25:07 PST
The Windows test failure (webanimations/accelerated-animation-removal-upon-transition-completion.html) is not relevant to this change.
Comment 8 WebKit Commit Bot 2019-12-02 12:21:20 PST
Comment on attachment 384637 [details]
Address comments

Clearing flags on attachment: 384637

Committed r253005: <https://trac.webkit.org/changeset/253005>