Title: [246859] trunk/Source/WebKit
- Revision
- 246859
- Author
- [email protected]
- Date
- 2019-06-26 17:18:19 -0700 (Wed, 26 Jun 2019)
Log Message
[iPadOS] Fix another crash in -[UIPreviewTarget initWithContainer:center:transform:] when generating a fallback targeted preview
https://bugs.webkit.org/show_bug.cgi?id=199243
<rdar://problem/51554509>
Reviewed by Tim Horton.
Additionally make createFallbackTargetedPreview robust in the case where the content view is unparented, and
rename _ensureTargetedPreview to _createTargetedPreviewIfPossible, to reflect the fact that it may now return
nil.
* UIProcess/ios/WKContentViewInteraction.mm:
(createTargetedPreview):
(createFallbackTargetedPreview):
(-[WKContentView _createTargetedPreviewIfPossible]):
(-[WKContentView contextMenuInteraction:previewForHighlightingMenuWithConfiguration:]):
(-[WKContentView contextMenuInteraction:previewForDismissingMenuWithConfiguration:]):
(-[WKContentView _ensureTargetedPreview]): Deleted.
Modified Paths
Diff
Modified: trunk/Source/WebKit/ChangeLog (246858 => 246859)
--- trunk/Source/WebKit/ChangeLog 2019-06-27 00:17:35 UTC (rev 246858)
+++ trunk/Source/WebKit/ChangeLog 2019-06-27 00:18:19 UTC (rev 246859)
@@ -1,3 +1,23 @@
+2019-06-26 Wenson Hsieh <[email protected]>
+
+ [iPadOS] Fix another crash in -[UIPreviewTarget initWithContainer:center:transform:] when generating a fallback targeted preview
+ https://bugs.webkit.org/show_bug.cgi?id=199243
+ <rdar://problem/51554509>
+
+ Reviewed by Tim Horton.
+
+ Additionally make createFallbackTargetedPreview robust in the case where the content view is unparented, and
+ rename _ensureTargetedPreview to _createTargetedPreviewIfPossible, to reflect the fact that it may now return
+ nil.
+
+ * UIProcess/ios/WKContentViewInteraction.mm:
+ (createTargetedPreview):
+ (createFallbackTargetedPreview):
+ (-[WKContentView _createTargetedPreviewIfPossible]):
+ (-[WKContentView contextMenuInteraction:previewForHighlightingMenuWithConfiguration:]):
+ (-[WKContentView contextMenuInteraction:previewForDismissingMenuWithConfiguration:]):
+ (-[WKContentView _ensureTargetedPreview]): Deleted.
+
2019-06-26 Alex Christensen <[email protected]>
testRunner.setAlwaysAcceptCookies should wait for cookie accept policy to be set
Modified: trunk/Source/WebKit/UIProcess/ios/WKContentViewInteraction.mm (246858 => 246859)
--- trunk/Source/WebKit/UIProcess/ios/WKContentViewInteraction.mm 2019-06-27 00:17:35 UTC (rev 246858)
+++ trunk/Source/WebKit/UIProcess/ios/WKContentViewInteraction.mm 2019-06-27 00:18:19 UTC (rev 246859)
@@ -7921,6 +7921,9 @@
static RetainPtr<UITargetedPreview> createFallbackTargetedPreview(UIView *rootView, UIView *containerView, const WebCore::FloatRect& frameInRootViewCoordinates)
{
+ if (!containerView.window)
+ return nil;
+
auto parameters = adoptNS([[UIPreviewParameters alloc] init]);
UIView *snapshotView = [rootView resizableSnapshotViewFromRect:frameInRootViewCoordinates afterScreenUpdates:NO withCapInsets:UIEdgeInsetsZero];
@@ -7933,7 +7936,7 @@
return adoptNS([[UITargetedPreview alloc] initWithView:snapshotView parameters:parameters.get() target:target.get()]);
}
-- (UITargetedPreview *)_ensureTargetedPreview
+- (UITargetedPreview *)_createTargetedPreviewIfPossible
{
if (_contextMenuInteractionTargetedPreview)
return _contextMenuInteractionTargetedPreview.get();
@@ -7960,7 +7963,7 @@
- (UITargetedPreview *)contextMenuInteraction:(UIContextMenuInteraction *)interaction previewForHighlightingMenuWithConfiguration:(UIContextMenuConfiguration *)configuration
{
[self _startSuppressingSelectionAssistantForReason:WebKit::InteractionIsHappening];
- return [self _ensureTargetedPreview];
+ return [self _createTargetedPreviewIfPossible];
}
- (void)contextMenuInteractionWillPresent:(UIContextMenuInteraction *)interaction
@@ -7981,7 +7984,7 @@
- (UITargetedPreview *)contextMenuInteraction:(UIContextMenuInteraction *)interaction previewForDismissingMenuWithConfiguration:(UIContextMenuConfiguration *)configuration
{
- return [self _ensureTargetedPreview];
+ return [self _createTargetedPreviewIfPossible];
}
- (void)contextMenuInteraction:(UIContextMenuInteraction *)interaction willCommitWithAnimator:(id<UIContextMenuInteractionCommitAnimating>)animator
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes