Title: [248690] trunk/Source/WebKit
Revision
248690
Author
d...@apple.com
Date
2019-08-14 15:13:08 -0700 (Wed, 14 Aug 2019)

Log Message

v3: CrashTracer: Regression : MobileSafari at UIKitCore: -[UITargetedPreview initWithView:parameters:]
https://bugs.webkit.org/show_bug.cgi?id=200634

Patch by Luming Yin <luming_...@apple.com> on 2019-08-14
Reviewed by Simon Fraser.

Under rare race conditions, the WKContentView may no longer have an associated window. However,
UIContextMenuInteraction may still attempt initialize a UITargetedPreview with the orphaned
WKContentView. Speculative fix for crashes under such scenarios, so that we can continue without
a context menu configuration to prevent the UIKit exception.

* UIProcess/ios/WKContentViewInteraction.mm:
(-[WKContentView continueContextMenuInteraction:]):

Modified Paths

Diff

Modified: trunk/Source/WebKit/ChangeLog (248689 => 248690)


--- trunk/Source/WebKit/ChangeLog	2019-08-14 22:08:11 UTC (rev 248689)
+++ trunk/Source/WebKit/ChangeLog	2019-08-14 22:13:08 UTC (rev 248690)
@@ -1,3 +1,18 @@
+2019-08-14  Luming Yin  <luming_...@apple.com>
+
+        v3: CrashTracer: Regression : MobileSafari at UIKitCore: -[UITargetedPreview initWithView:parameters:]
+        https://bugs.webkit.org/show_bug.cgi?id=200634
+
+        Reviewed by Simon Fraser.
+
+        Under rare race conditions, the WKContentView may no longer have an associated window. However, 
+        UIContextMenuInteraction may still attempt initialize a UITargetedPreview with the orphaned 
+        WKContentView. Speculative fix for crashes under such scenarios, so that we can continue without 
+        a context menu configuration to prevent the UIKit exception.
+
+        * UIProcess/ios/WKContentViewInteraction.mm:
+        (-[WKContentView continueContextMenuInteraction:]):
+
 2019-08-14  Zalan Bujtas  <za...@apple.com>
 
         [ContentChangeObserver] Stop content change observation explicitly.

Modified: trunk/Source/WebKit/UIProcess/ios/WKContentViewInteraction.mm (248689 => 248690)


--- trunk/Source/WebKit/UIProcess/ios/WKContentViewInteraction.mm	2019-08-14 22:08:11 UTC (rev 248689)
+++ trunk/Source/WebKit/UIProcess/ios/WKContentViewInteraction.mm	2019-08-14 22:13:08 UTC (rev 248690)
@@ -7932,6 +7932,9 @@
 
 - (void)continueContextMenuInteraction:(void(^)(UIContextMenuConfiguration *))continueWithContextMenuConfiguration
 {
+    if (!self.window)
+        return continueWithContextMenuConfiguration(nil);
+
     if (!_positionInformation.touchCalloutEnabled)
         return continueWithContextMenuConfiguration(nil);
 
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to