WebKit Bugzilla
Attachment 373051 Details for
Bug 199285
: [iOS] Stop using cached UITargetedPreviews from previous interactions when starting a new context menu interaction
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
Patch
bug-199285-20190627134942.patch (text/plain), 3.71 KB, created by
Andy Estes
on 2019-06-27 13:49:42 PDT
(
hide
)
Description:
Patch
Filename:
MIME Type:
Creator:
Andy Estes
Created:
2019-06-27 13:49:42 PDT
Size:
3.71 KB
patch
obsolete
>Subversion Revision: 246896 >diff --git a/Source/WebKit/ChangeLog b/Source/WebKit/ChangeLog >index dcb3e109101ae7c82471a0356db0837bcc825f13..399a320ec3402827b53422c800a3a8d8e37e1186 100644 >--- a/Source/WebKit/ChangeLog >+++ b/Source/WebKit/ChangeLog >@@ -1,3 +1,33 @@ >+2019-06-27 Andy Estes <aestes@apple.com> >+ >+ [iOS] Stop using cached UITargetedPreviews from previous interactions when starting a new context menu interaction >+ https://bugs.webkit.org/show_bug.cgi?id=199285 >+ <rdar://problem/52074916> >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ WKContentView was caching the UITargetedPreview created in >+ -contextMenuInteraction:previewForHighlightingMenuWithConfiguration: for later reuse by >+ -contextMenuInteraction:previewForDismissingMenuWithConfiguration:. The cached value was >+ then cleared in -contextMenuInteractionDidEnd:. >+ >+ This was wrong, because -contextMenuInteractionDidEnd: can be called before >+ -contextMenuInteraction:previewForDismissingMenuWithConfiguration:, so we would clear the >+ cache then create and cache a new UITargetedPreview during dismissal. Then when a new >+ context menu interaction started, we'd reuse the targeted preview created for the previous >+ dismissal (which has the wrong geometry). >+ >+ Stop assuming an ordering between >+ -contextMenuInteraction:previewForDismissingMenuWithConfiguration: and >+ -contextMenuInteractionDidEnd:. Instead, always create and cache a new UITargetedPreview in >+ -contextMenuInteraction:previewForHighlightingMenuWithConfiguration:, then reuse it and >+ clear the cache in -contextMenuInteraction:previewForDismissingMenuWithConfiguration:. >+ >+ * UIProcess/ios/WKContentViewInteraction.mm: >+ (-[WKContentView _createTargetedPreviewIfPossible]): >+ (-[WKContentView contextMenuInteraction:previewForDismissingMenuWithConfiguration:]): >+ (-[WKContentView contextMenuInteractionDidEnd:]): >+ > 2019-06-27 Carlos Garcia Campos <cgarcia@igalia.com> > > WebSockets: avoid data copies when queuing tasks in WebSocketChannel >diff --git a/Source/WebKit/UIProcess/ios/WKContentViewInteraction.mm b/Source/WebKit/UIProcess/ios/WKContentViewInteraction.mm >index 33938e495dfeb5b35d950d41cae488b982b2490f..086766360e07ee2197d61fa3bb297aae977d3288 100644 >--- a/Source/WebKit/UIProcess/ios/WKContentViewInteraction.mm >+++ b/Source/WebKit/UIProcess/ios/WKContentViewInteraction.mm >@@ -7944,9 +7944,6 @@ static RetainPtr<UITargetedPreview> createFallbackTargetedPreview(UIView *rootVi > > - (UITargetedPreview *)_createTargetedPreviewIfPossible > { >- if (_contextMenuInteractionTargetedPreview) >- return _contextMenuInteractionTargetedPreview.get(); >- > RetainPtr<UITargetedPreview> targetedPreview; > > if (_positionInformation.isLink && _positionInformation.linkIndicator.contentImage) { >@@ -7990,7 +7987,7 @@ - (void)contextMenuInteractionWillPresent:(UIContextMenuInteraction *)interactio > > - (UITargetedPreview *)contextMenuInteraction:(UIContextMenuInteraction *)interaction previewForDismissingMenuWithConfiguration:(UIContextMenuConfiguration *)configuration > { >- return [self _createTargetedPreviewIfPossible]; >+ return std::exchange(_contextMenuInteractionTargetedPreview, nil).autorelease(); > } > > - (void)contextMenuInteraction:(UIContextMenuInteraction *)interaction willCommitWithAnimator:(id<UIContextMenuInteractionCommitAnimating>)animator >@@ -8070,7 +8067,6 @@ - (void)contextMenuInteractionDidEnd:(UIContextMenuInteraction *)interaction > _contextMenuLegacyMenu = nullptr; > _contextMenuHasRequestedLegacyData = NO; > _contextMenuElementInfo = nullptr; >- _contextMenuInteractionTargetedPreview = nil; > } > > #endif // USE(UICONTEXTMENU)
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Formatted Diff
|
Diff
Attachments on
bug 199285
: 373051