New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. Weβll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Adjust ContextMenu animation #14572
Adjust ContextMenu animation #14572
Conversation
EWS run on previous version of this PR (hash ce378fd) |
ce378fd
to
22c0bd2
Compare
EWS run on current version of this PR (hash 22c0bd2) |
EWS run on previous version of this PR (hash 22c0bd2) |
@@ -12576,7 +12582,7 @@ - (void)contextMenuInteraction:(UIContextMenuInteraction *)interaction willPerfo | |||
if (!_webView) | |||
return; | |||
|
|||
[self _stopSuppressingSelectionAssistantForReason:WebKit::InteractionIsHappening]; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We call _stopSuppressingSelectionAssistantForReason
in -[UIContextMenuInteractionDelegate contextMenuInteraction:willEndForConfiguration:animator:]
so I think it's not needed here.
Calling [_textInteractionAssistant activateSelection]
(which is called from _stopSuppressingSelectionAssistantForReason
) before the animation completes was breaking the animation's origin.
@@ -12690,15 +12696,22 @@ - (void)contextMenuInteraction:(UIContextMenuInteraction *)interaction willEndFo | |||
_contextMenuHasRequestedLegacyData = NO; | |||
_contextMenuElementInfo = nullptr; | |||
|
|||
[animator addCompletion:[weakSelf = WeakObjCPtr<WKContentView>(self)] () { | |||
auto lambda = [weakSelf = WeakObjCPtr<WKContentView>(self)] () { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this should probably have a better name than just :lambda:?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I could name it tearDownAfterAnimation
but if animator is nil (like on Catalyst) it happens immediately.
I'm certainly open to suggestions but previously the lambda had no name so using lambda seemed reasonable.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
contextFinalizer or something?
22c0bd2
to
ac200b2
Compare
EWS run on current version of this PR (hash ac200b2) |
https://bugs.webkit.org/show_bug.cgi?id=257540 <radar://107716428> Reviewed by Dean Jackson. Change behavior of context menu animation such that fading is used instead of morphing when tapping on the preview. * Source/WebKit/UIProcess/ios/WKContentViewInteraction.h: * Source/WebKit/UIProcess/ios/WKContentViewInteraction.mm: (-[WKContentView _contextMenuInteraction:configurationForMenuAtLocation:completion:]): (-[WKContentView contextMenuInteraction:configuration:dismissalPreviewForItemWithIdentifier:contextMenuInteraction:previewForDismissingMenuWithConfiguration:]): (-[WKContentView contextMenuInteraction:willPerformPreviewActionForMenuWithConfiguration:animator:]): (-[WKContentView contextMenuInteraction:willEndForConfiguration:animator:]): Canonical link: https://commits.webkit.org/264817@main
ac200b2
to
4ee917d
Compare
Committed 264817@main (4ee917d): https://commits.webkit.org/264817@main Reviewed commits have been landed. Closing PR #14572 and removing active labels. |
4ee917d
ac200b2
π wincairoπ§ͺ api-macπ§ͺ gtk-wk2π§ͺ api-iosπ§ͺ mac-wk2π§ͺ api-gtkπ§ͺ mac-AS-debug-wk2π watch