Branch: refs/heads/main
Home: https://github.com/WebKit/WebKit
Commit: 68804befa581ffb5958ac04a3b45895b742bf491
https://github.com/WebKit/WebKit/commit/68804befa581ffb5958ac04a3b45895b742bf491
Author: Wenson Hsieh <[email protected]>
Date: 2023-10-02 (Mon, 02 Oct 2023)
Changed paths:
M Source/WebKit/Platform/spi/ios/UIKitSPI.h
M Source/WebKit/UIProcess/ios/CompactContextMenuPresenter.mm
M Source/WebKit/UIProcess/ios/WKActionSheetAssistant.mm
M Source/WebKit/UIProcess/ios/forms/WKFormSelectPicker.mm
M Source/WebKit/UIProcess/ios/forms/WKFormSelectPopover.mm
M Tools/WebKitTestRunner/cocoa/TestRunnerWKWebView.mm
Log Message:
-----------
Stop using -_contextMenuInteraction:styleForMenuWithConfiguration: in
WKActionSheetAssistant and WKFormSelectPicker
https://bugs.webkit.org/show_bug.cgi?id=262445
rdar://116287832
Reviewed by Aditya Keerthi.
Adopt `CompactContextMenuPresenter` in `WKActionSheetAssistant.mm` and
`WKFormSelectPicker.mm` to
replace more `-_contextMenuInteraction:styleForMenuWithConfiguration:`
overrides. See below for more
details.
* Source/WebKit/Platform/spi/ios/UIKitSPI.h:
* Source/WebKit/UIProcess/ios/CompactContextMenuPresenter.mm:
(WebKit::CompactContextMenuPresenter::present):
Add a check for the case where the root view isn't parented, and avoid trying
to present a context
menu. This matches existing behavior in `-[WKContentView
presentContextMenu:atLocation:]`.
* Source/WebKit/UIProcess/ios/WKActionSheetAssistant.mm:
(-[WKActionSheetAssistant dealloc]):
(-[WKActionSheetAssistant _dataDetectorContextMenuPresenter]):
(-[WKActionSheetAssistant _resetDataDetectorContextMenuPresenter]):
(-[WKActionSheetAssistant _mediaControlsContextMenuPresenter]):
(-[WKActionSheetAssistant _resetMediaControlsContextMenuPresenter]):
(-[WKActionSheetAssistant hasContextMenuInteraction]):
(-[WKActionSheetAssistant showDataDetectorsUIForPositionInformation:]):
(-[WKActionSheetAssistant
showMediaControlsContextMenu:items:completionHandler:]):
(-[WKActionSheetAssistant
contextMenuInteraction:configurationForMenuAtLocation:]):
(-[WKActionSheetAssistant
contextMenuInteraction:configuration:highlightPreviewForItemWithIdentifier:]):
(-[WKActionSheetAssistant
contextMenuInteraction:willEndForConfiguration:animator:]):
(-[WKActionSheetAssistant
_contextMenuInteraction:overrideSuggestedActionsForConfiguration:]):
(-[WKActionSheetAssistant _ensureDataDetectorContextMenuInteraction]): Deleted.
(-[WKActionSheetAssistant _removeDataDetectorContextMenuInteraction]): Deleted.
(-[WKActionSheetAssistant _ensureMediaControlsContextMenuInteraction]): Deleted.
(-[WKActionSheetAssistant _removeMediaControlsContextMenuInteraction]): Deleted.
(-[WKActionSheetAssistant
_contextMenuInteraction:styleForMenuWithConfiguration:]): Deleted.
Replace `_dataDetectorContextMenuInteraction` and
`_mediaControlsContextMenuInteraction` with
`CompactContextMenuPresenter`s, and adopt the corresponding replacement methods
for requesting
programmatic context menu presentation.
* Source/WebKit/UIProcess/ios/forms/WKFormSelectPicker.mm:
(-[WKSelectPicker controlEndEditing]):
(-[WKSelectPicker dealloc]):
(-[WKSelectPicker createMenu]):
(-[WKSelectPicker resetContextMenuPresenter]):
Only call `-[WKWebView _didDismissContextMenu]` here if we're not already
waiting for animated
context menu dismissal to complete; this adjustment is needed to avoid
duplicate calls to
`-_didDismissContextMenu`, which breaks logic in some layout tests that waits
for context menus to
dismiss after blurring select elements.
(-[WKSelectPicker showSelectPicker]):
(-[WKSelectPicker _contextMenuInteraction:styleForMenuWithConfiguration:]):
Deleted.
(-[WKSelectPicker removeContextMenuInteraction]): Deleted.
(-[WKSelectPicker ensureContextMenuInteraction]): Deleted.
Replace `_selectContextMenuInteraction` with a `CompactContextMenuPresenter`.
Canonical link: https://commits.webkit.org/268742@main
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes