[webkit-changes] [WebKit/WebKit] fdc295: MobileMail sometimes crashes underneath -[WKConten...
Wenson Hsieh
noreply at github.com
Thu Oct 20 14:46:45 PDT 2022
Branch: refs/heads/main
Home: https://github.com/WebKit/WebKit
Commit: fdc295002ed6c111bc2e2ea618e4c294b68daedf
https://github.com/WebKit/WebKit/commit/fdc295002ed6c111bc2e2ea618e4c294b68daedf
Author: Wenson Hsieh <wenson_hsieh at apple.com>
Date: 2022-10-20 (Thu, 20 Oct 2022)
Changed paths:
M Source/WebKit/UIProcess/ios/WKContentViewInteraction.mm
M Tools/TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj
A Tools/TestWebKitAPI/Tests/ios/CustomContentViewGestures.mm
Log Message:
-----------
MobileMail sometimes crashes underneath -[WKContentView(WKInteraction) deferringGestures]
https://bugs.webkit.org/show_bug.cgi?id=246823
rdar://100971798
Reviewed by Megan Gardner.
>From crash telemetry, it's apparently possible for UIKit to call into WKContentView's gesture
recognizer delegate methods before `-setUpInteraction` has been invoked. If this happens, we end up
crashing due to an ObjC exception, when attempting to insert nil deferring gestures into an array
under the call to `-deferringGestures`. While I wasn't able to reproduce this crash in Mail, I was
able to reproduce it by creating a simple test app that:
1. Creates a new `WKWebView`
2. Immediately calls `_close` on the web view (thereby preventing a web process from being launched
right away upon being parented)
3. Parent the web view in a visible window
4. Create new `UIGestureRecognizer`s and add them to the content view
5. Call into `-gestureRecognizer:shouldRecognizeSimultaneouslyWithGestureRecognizer:` with the
custom gestures.
To fix this, we simply make `-deferringGestures` robust in this case by adding null checks.
Test: CustomContentViewGestures.DoNotCrashWhenCheckingGestureDelegateInNewWebView
* Source/WebKit/UIProcess/ios/WKContentViewInteraction.mm:
(-[WKContentView deferringGestures]):
* Tools/TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj:
* Tools/TestWebKitAPI/Tests/ios/CustomContentViewGestures.mm: Added.
Canonical link: https://commits.webkit.org/255804@main
More information about the webkit-changes
mailing list