WebKit Bugzilla
New
Browse
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
RESOLVED FIXED
204664
[iOS] WKWebView touch event gesture recognition should not block the application process main thread when possible
https://bugs.webkit.org/show_bug.cgi?id=204664
Summary
[iOS] WKWebView touch event gesture recognition should not block the applicat...
Wenson Hsieh
Reported
2019-11-27 22:35:23 PST
<
rdar://problem/38670692
>
Attachments
First pass
(59.12 KB, patch)
2019-12-05 14:23 PST
,
Wenson Hsieh
no flags
Details
Formatted Diff
Diff
Fix iOS tests on non-internal builds
(61.96 KB, patch)
2019-12-06 11:21 PST
,
Wenson Hsieh
thorton
: review+
Details
Formatted Diff
Diff
For EWS
(62.53 KB, patch)
2019-12-07 17:18 PST
,
Wenson Hsieh
no flags
Details
Formatted Diff
Diff
Show Obsolete
(1)
View All
Add attachment
proposed patch, testcase, etc.
Wenson Hsieh
Comment 1
2019-11-27 22:36:59 PST
...the hope is to eliminate all hangs under -[WKContentView(WKInteraction) _webTouchEventsRecognized:].
Wenson Hsieh
Comment 2
2019-12-05 14:23:17 PST
Comment hidden (obsolete)
Created
attachment 384949
[details]
First pass
Wenson Hsieh
Comment 3
2019-12-06 11:21:36 PST
Created
attachment 385027
[details]
Fix iOS tests on non-internal builds
Tim Horton
Comment 4
2019-12-06 17:08:38 PST
Comment on
attachment 385027
[details]
Fix iOS tests on non-internal builds View in context:
https://bugs.webkit.org/attachment.cgi?id=385027&action=review
> Source/WebKit/UIProcess/WebPageProxy.cpp:2818 > + --m_handlingPreventableTouchStartCount;
This needs some sort of care in the underflow case. Also, it's possible we don't want to do all this work in the error case (at least on crash?)? I'm not really sure.
> Source/WebKit/UIProcess/ios/WKContentViewInteraction.h:168 > +#define USE_DEFERRING_GESTURE_RECOGNIZERS ENABLE(IOS_TOUCH_EVENTS)
This is fairly surprising to me. I don't usually like it when a USE() or ENABLE() is in a header that you can possibly not have (so prefix header or Platform.h/FeatureDefines.h and friends are OK, but here would not be), but 🤷♂️
> Source/WebKit/UIProcess/ios/WKContentViewInteraction.mm:4211 > + [_twoFingerDoubleTapGestureRecognizer setEnabled:NO]; > + [_twoFingerDoubleTapGestureRecognizer setEnabled:YES];
Wonder if we should just add a _wk_cancel category method on UIGR :) this comes up enough
Tim Horton
Comment 5
2019-12-06 17:08:55 PST
Prediction: this will not be the last patch in this series :)
Wenson Hsieh
Comment 6
2019-12-06 17:12:57 PST
(In reply to Tim Horton from
comment #5
)
> Prediction: this will not be the last patch in this series :)
Quite likely :(
Wenson Hsieh
Comment 7
2019-12-06 21:31:59 PST
Comment on
attachment 385027
[details]
Fix iOS tests on non-internal builds View in context:
https://bugs.webkit.org/attachment.cgi?id=385027&action=review
>> Source/WebKit/UIProcess/WebPageProxy.cpp:2818 >> + --m_handlingPreventableTouchStartCount; > > This needs some sort of care in the underflow case. Also, it's possible we don't want to do all this work in the error case (at least on crash?)? I'm not really sure.
I’ll assert that it should never be zero here, and also avoid incrementing past 0 for the underflow case. It also looks like the work here is not necessary in the case where the web process terminates, since the gestures should be reset anyways by -cleanupInteraction in WKContentView. I’ll double check by forcing the web process to crash while handling a touchstart.
>> Source/WebKit/UIProcess/ios/WKContentViewInteraction.h:168 >> +#define USE_DEFERRING_GESTURE_RECOGNIZERS ENABLE(IOS_TOUCH_EVENTS) > > This is fairly surprising to me. I don't usually like it when a USE() or ENABLE() is in a header that you can possibly not have (so prefix header or Platform.h/FeatureDefines.h and friends are OK, but here would not be), but 🤷♂️
Good point! I’ll change these to just be ENABLE(IOS_TOUCH_EVENTS) instead.
>> Source/WebKit/UIProcess/ios/WKContentViewInteraction.mm:4211 >> + [_twoFingerDoubleTapGestureRecognizer setEnabled:YES]; > > Wonder if we should just add a _wk_cancel category method on UIGR :) this comes up enough
Sounds good — I’ll add a -_wk_cancel category method on UIGestureRecognizer in this file.
Wenson Hsieh
Comment 8
2019-12-07 17:18:32 PST
Created
attachment 385109
[details]
For EWS
WebKit Commit Bot
Comment 9
2019-12-07 19:57:31 PST
Comment on
attachment 385109
[details]
For EWS Clearing flags on attachment: 385109 Committed
r253267
: <
https://trac.webkit.org/changeset/253267
>
Antoine Quint
Comment 10
2020-04-29 07:37:48 PDT
This caused
bug 211179
.
Antoine Quint
Comment 11
2020-05-07 03:39:54 PDT
This also caused
bug 211521
.
Note
You need to
log in
before you can comment on or make changes to this bug.
Top of Page
Format For Printing
XML
Clone This Bug