-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Use CompactContextMenuPresenter to show context menus for focused ele…
…ments with datalist https://bugs.webkit.org/show_bug.cgi?id=264038 rdar://117809656 Reviewed by Richard Robinson and Megan Gardner. Deploy `CompactContextMenuPresenter` in `WKDataListSuggestionsDropdown`, to support compact context menu presentation without relying on UIKit SPI. Note that this (in theory) means we no longer need logic to manually specify preferred edge insets for the suggestions menu, since we now lay out the hidden native `UIButton` over the bounds of the focused datalist element, which UIKit will automatically avoid obscuring when presenting or updating the menu. * Source/WebKit/Platform/spi/ios/UIKitSPI.h: Remove SPI declarations that are no longer necessary. * Source/WebKit/UIProcess/ios/CompactContextMenuPresenter.h: * Source/WebKit/UIProcess/ios/CompactContextMenuPresenter.mm: (WebKit::CompactContextMenuPresenter::updateVisibleMenu): * Source/WebKit/UIProcess/ios/WKContentViewInteraction.h: * Source/WebKit/UIProcess/ios/WKContentViewInteraction.mm: (-[WKContentView _createTargetedContextMenuHintPreviewForFocusedElement:]): (-[WKContentView _createTargetedContextMenuHintPreviewForFocusedElement]): Deleted. Add support for an option to create a targeted context menu hint that's positioned against the left or right edge of the input, provided there's sufficient space to fit the 250pt (by default) menu. When the view is RTL, note that we'll prefer to position the menu at the the right edge of the element, fall back to the left edge if there's not enough horizonal space, and finally fall back to the element rect itself if there's no space on either side. * Source/WebKit/UIProcess/ios/WebDataListSuggestionsDropdownIOS.mm: (-[WKDataListSuggestionsDropdown _showSuggestions]): (-[WKDataListSuggestionsDropdown _removeContextMenuInteraction]): (-[WKDataListSuggestionsDropdown contextMenuInteraction:configuration:highlightPreviewForItemWithIdentifier:]): (-[WKDataListSuggestionsDropdown _preferredEdgeInsetsForSuggestionsMenu]): Deleted. (-[WKDataListSuggestionsDropdown _contextMenuInteraction:styleForMenuWithConfiguration:]): Deleted. * Source/WebKit/UIProcess/ios/forms/WKFormSelectPicker.mm: (-[WKSelectPicker contextMenuInteraction:configuration:highlightPreviewForItemWithIdentifier:]): Canonical link: https://commits.webkit.org/270373@main
- Loading branch information
Showing
7 changed files
with
71 additions
and
49 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters