[webkit-changes] [WebKit/WebKit] 9032fd: [iOS] Chrome crashes when showing an edit menu whe...
Wenson Hsieh
noreply at github.com
Fri Dec 15 13:31:33 PST 2023
Branch: refs/heads/main
Home: https://github.com/WebKit/WebKit
Commit: 9032fde71088227c984b05588cea41003592284f
https://github.com/WebKit/WebKit/commit/9032fde71088227c984b05588cea41003592284f
Author: Wenson Hsieh <wenson_hsieh at apple.com>
Date: 2023-12-15 (Fri, 15 Dec 2023)
Changed paths:
A LayoutTests/editing/selection/ios/select-text-with-long-press-actions-disabled-expected.txt
A LayoutTests/editing/selection/ios/select-text-with-long-press-actions-disabled.html
M Source/WebKit/UIProcess/ios/WKContentViewInteraction.mm
M Tools/WebKitTestRunner/TestOptions.cpp
M Tools/WebKitTestRunner/TestOptions.h
M Tools/WebKitTestRunner/cocoa/TestControllerCocoa.mm
Log Message:
-----------
[iOS] Chrome crashes when showing an edit menu when async text input is enabled
https://bugs.webkit.org/show_bug.cgi?id=266488
rdar://119720176
Reviewed by Tim Horton.
Fix an ObjC memory management error in `-contextMenuInteraction:configurationForMenuAtLocation:`
that causes Chrome on iOS to crash after long pressing text, when `UIKit/async_text_input` is
enabled. Instead of returning a reference to the `asyncConfiguration` temporary, this needs to
return an autoreleased object.
This happens because Chrome sets `_longPressActionsEnabled` on the web view configuration to `NO`,
which causes `-_internalContextMenuInteraction:configurationForMenuAtLocation:completion:` to return
immediately, which in turn causes the async configuration to be invalid after returning from the
context menu configuration delegate method.
* LayoutTests/editing/selection/ios/select-text-with-long-press-actions-disabled-expected.txt: Added.
* LayoutTests/editing/selection/ios/select-text-with-long-press-actions-disabled.html: Added.
* Source/WebKit/UIProcess/ios/WKContentViewInteraction.mm:
(-[WKContentView contextMenuInteraction:configurationForMenuAtLocation:]):
* Tools/WebKitTestRunner/TestOptions.cpp:
Add a new test option to disable long press actions, for the new layout test.
(WTR::TestOptions::defaults):
(WTR::TestOptions::keyTypeMapping):
* Tools/WebKitTestRunner/TestOptions.h:
(WTR::TestOptions::longPressActionsEnabled const):
* Tools/WebKitTestRunner/cocoa/TestControllerCocoa.mm:
(WTR::TestController::platformCreateWebView):
Canonical link: https://commits.webkit.org/272144@main
More information about the webkit-changes
mailing list