Bug 222216 - [iOS] Add a watchdog timer to forcibly reset deferring gesture recognizers
Summary: [iOS] Add a watchdog timer to forcibly reset deferring gesture recognizers
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: UI Events (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Wenson Hsieh
URL:
Keywords: InRadar
Depends on: 222291
Blocks:
  Show dependency treegraph
 
Reported: 2021-02-19 17:31 PST by Wenson Hsieh
Modified: 2021-02-23 06:35 PST (History)
6 users (show)

See Also:


Attachments
Patch (36.43 KB, patch)
2021-02-22 14:31 PST, Wenson Hsieh
no flags Details | Formatted Diff | Diff
Patch (26.84 KB, patch)
2021-02-22 14:40 PST, Wenson Hsieh
ews-feeder: commit-queue-
Details | Formatted Diff | Diff
Patch (33.23 KB, patch)
2021-02-22 14:43 PST, Wenson Hsieh
simon.fraser: review+
ews-feeder: commit-queue-
Details | Formatted Diff | Diff
For EWS (fix builds + rebase) (31.60 KB, patch)
2021-02-22 20:51 PST, Wenson Hsieh
no flags Details | Formatted Diff | Diff
Unified source build fix (32.20 KB, patch)
2021-02-22 22:38 PST, 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 2021-02-19 17:31:35 PST
...with a log fault or something.

This should make it significantly easier to diagnose the family of bugs that result from WKDeferringGestureRecognizers being permanently stuck in Possible state.
Comment 1 Wenson Hsieh 2021-02-22 14:31:59 PST Comment hidden (obsolete)
Comment 2 Wenson Hsieh 2021-02-22 14:40:27 PST Comment hidden (obsolete)
Comment 3 Wenson Hsieh 2021-02-22 14:43:12 PST
Created attachment 421241 [details]
Patch
Comment 4 Simon Fraser (smfr) 2021-02-22 14:46:43 PST
Comment on attachment 421241 [details]
Patch

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

> Source/WebKit/UIProcess/ios/WKContentViewInteraction.h:502
> +@interface WKContentView (WKInteraction) <UIGestureRecognizerDelegate, UITextAutoscrolling, UITextInputMultiDocument, UITextInputPrivate, UIWebFormAccessoryDelegate, UIWebTouchEventsGestureRecognizerDelegate, UIWKInteractionViewProtocol, WKActionSheetAssistantDelegate, WKFileUploadPanelDelegate, WKKeyboardScrollViewAnimatorDelegate , WKDeferringGestureRecognizerDelegate

extra space here.
Comment 5 Wenson Hsieh 2021-02-22 14:49:15 PST
Comment on attachment 421241 [details]
Patch

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

Thanks for the review!

> Source/WebKit/UIProcess/ios/GestureRecognizerConsistencyEnforcer.mm:34
> +GestureRecognizerConsistencyEnforcer::GestureRecognizerConsistencyEnforcer(WKContentView *view)

I also forgot to wrap this in a `PLATFORM(IOS_FAMILY)` guard, so this is currently failing macOS builds.

>> Source/WebKit/UIProcess/ios/WKContentViewInteraction.h:502
>> +@interface WKContentView (WKInteraction) <UIGestureRecognizerDelegate, UITextAutoscrolling, UITextInputMultiDocument, UITextInputPrivate, UIWebFormAccessoryDelegate, UIWebTouchEventsGestureRecognizerDelegate, UIWKInteractionViewProtocol, WKActionSheetAssistantDelegate, WKFileUploadPanelDelegate, WKKeyboardScrollViewAnimatorDelegate , WKDeferringGestureRecognizerDelegate
> 
> extra space here.

Good catch — fixed!
Comment 6 Wenson Hsieh 2021-02-22 15:30:56 PST
> /Volumes/Data/worker/watchOS-7-Simulator-Build-EWS/build/WebKitBuild/Release-watchsimulator/WebCore.framework/PrivateHeaders/UIEvent.h:35:7: note: candidate found by name lookup is 'WebCore::UIEvent'
> class UIEvent : public Event {
>       ^
> In file included from /Volumes/Data/worker/watchOS-7-Simulator-Build-EWS/build/WebKitBuild/Release-watchsimulator/DerivedSources/WebKit2/unified-sources/UnifiedSource48-mm.mm:7:
> /Volumes/Data/worker/watchOS-7-Simulator-Build-EWS/build/Source/WebKit/UIProcess/ios/forms/WKFocusedFormControlView.mm:136:34: error: cannot initialize a parameter of type 'UIEvent *' with an lvalue of type 'WebCore::UIEvent *'
>     [self _wheelChangedWithEvent:event];

watchOS build failure is due to unified sources grouping `WebPageProxyIOS.mm` in with `WKFocusedFormControlView.mm`, and then WebKit code doesn't know how to disambiguate `UIEvent` from UIKit vs. `WebCore::UIEvent`.

The declaration for `WebCore::UIEvent` is coming from this include chain:

> In file included from /Volumes/Data/worker/watchOS-7-Build-EWS/build/WebKitBuild/Release-watchos/DerivedSources/WebKit2/unified-sources/UnifiedSource48-mm.mm:1:
> In file included from /Volumes/Data/worker/watchOS-7-Build-EWS/build/Source/WebKit/UIProcess/ios/WebPageProxyIOS.mm:27:
> In file included from /Volumes/Data/worker/watchOS-7-Build-EWS/build/Source/WebKit/UIProcess/WebPageProxy.h:70:
> In file included from /Volumes/Data/worker/watchOS-7-Build-EWS/build/Source/WebKit/UIProcess/WebFrameProxy.h:30:
> In file included from /Volumes/Data/worker/watchOS-7-Build-EWS/build/Source/WebKit/UIProcess/GenericCallback.h:33:
> In file included from /Volumes/Data/worker/watchOS-7-Build-EWS/build/Source/WebKit/UIProcess/API/C/WKAPICast.h:44:
> In file included from /Volumes/Data/worker/watchOS-7-Build-EWS/build/Source/WebKit/Shared/API/c/WKSharedAPICast.h:50:
> In file included from /Volumes/Data/worker/watchOS-7-Build-EWS/build/Source/WebKit/Shared/WebMouseEvent.h:34:
> In file included from /Volumes/Data/worker/watchOS-7-Build-EWS/build/WebKitBuild/Release-watchos/WebCore.framework/PrivateHeaders/PointerEvent.h:29:
> In file included from /Volumes/Data/worker/watchOS-7-Build-EWS/build/WebKitBuild/Release-watchos/WebCore.framework/PrivateHeaders/MouseEvent.h:27:
> In file included from /Volumes/Data/worker/watchOS-7-Build-EWS/build/WebKitBuild/Release-watchos/WebCore.framework/PrivateHeaders/MouseEventInit.h:28:
> In file included from /Volumes/Data/worker/watchOS-7-Build-EWS/build/WebKitBuild/Release-watchos/WebCore.framework/PrivateHeaders/MouseRelatedEvent.h:27:
> In file included from /Volumes/Data/worker/watchOS-7-Build-EWS/build/WebKitBuild/Release-watchos/WebCore.framework/PrivateHeaders/UIEventWithKeyState.h:28:

...it seems less than ideal for a shared UIProcess/WebProcess header (`WebMouseEvent.h`) to be importing WebCore headers that know about the DOM (`PointerEvent.h`).
Comment 7 Wenson Hsieh 2021-02-22 20:51:36 PST
Created attachment 421281 [details]
For EWS (fix builds + rebase)
Comment 8 Wenson Hsieh 2021-02-22 22:38:10 PST
Created attachment 421287 [details]
Unified source build fix
Comment 9 EWS 2021-02-23 06:34:43 PST
Committed r273305: <https://commits.webkit.org/r273305>

All reviewed patches have been landed. Closing bug and clearing flags on attachment 421287 [details].
Comment 10 Radar WebKit Bug Importer 2021-02-23 06:35:16 PST
<rdar://problem/74639714>