Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 39156fa7001f9faa2e8d4a2184d5c4614bf6175d
      
https://github.com/WebKit/WebKit/commit/39156fa7001f9faa2e8d4a2184d5c4614bf6175d
  Author: Jessica Cheung <[email protected]>
  Date:   2026-04-07 (Tue, 07 Apr 2026)

  Changed paths:
    A LayoutTests/fast/forms/ios/datalist-does-not-obscure-input-expected.txt
    A LayoutTests/fast/forms/ios/datalist-does-not-obscure-input.html
    M Source/WebKit/UIProcess/ios/CompactContextMenuPresenter.h
    M Source/WebKit/UIProcess/ios/CompactContextMenuPresenter.mm
    M Source/WebKit/UIProcess/ios/WebDataListSuggestionsDropdownIOS.mm

  Log Message:
  -----------
  REGRESSION (iOS 26): Datalist options obscure text input
https://bugs.webkit.org/show_bug.cgi?id=305719
rdar://168475613

Reviewed by Aditya Keerthi and Tim Horton.

In iOS 26, UIKit changed the behavior for UIButton. WebKit
used UIButton to programmatically trigger the
UIContextMenuInteraction and create/present the datalist.
As a consequence of the change, this overlap is the
expected behavior when using UIButton, even though it is not
expected behavior for datalists.

To fix this issue, WebKit now uses a UIControl for datalist
instead of a UIButton to trigger the UIContextMenuInteraction.
UIControl does not have this new expected behavior that the UIButton does.
For other CompactContextMenuPresenters, the UIButton is still used.

Alternatively, setting UIControl.showsMenuFromSource to NO would also
fix the issue but showsMenuFromSource is SPI, which WebKit cannot use.

Unfortunately, there isn't a straightforward way to make
WKCompactContextMenuPresenterButton (UIButton) subclass
WKCompactContextMenuPresenterControl (UIControl) even though UIButton is
a UIControl. As subclasses of UIControl respectively,
both need the minimum viable delegate implementation to be able to trigger
the UIContextMenuInteraction. As a result, the implementation has to be
duplicated for both.

Add an iOS layout test for datalists that check whether the datalist
overlaps with the text input or not.

* LayoutTests/fast/forms/ios/datalist-does-not-obscure-input-expected.txt: 
Added.
* LayoutTests/fast/forms/ios/datalist-does-not-obscure-input.html: Added.
* Source/WebKit/UIProcess/ios/CompactContextMenuPresenter.h:
* Source/WebKit/UIProcess/ios/CompactContextMenuPresenter.mm:
(-[WKCompactContextMenuPresenterControl 
contextMenuInteraction:configurationForMenuAtLocation:]):
(-[WKCompactContextMenuPresenterControl 
contextMenuInteraction:configuration:highlightPreviewForItemWithIdentifier:]):
(-[WKCompactContextMenuPresenterControl 
contextMenuInteraction:willDisplayMenuForConfiguration:animator:]):
(-[WKCompactContextMenuPresenterControl 
contextMenuInteraction:willEndForConfiguration:animator:]):
(WebKit::CompactContextMenuPresenter::CompactContextMenuPresenter):
(WebKit::CompactContextMenuPresenter::~CompactContextMenuPresenter):
(WebKit::CompactContextMenuPresenter::interaction const):
(WebKit::CompactContextMenuPresenter::present):
(WebKit::CompactContextMenuPresenter::dismiss):
* Source/WebKit/UIProcess/ios/WebDataListSuggestionsDropdownIOS.mm:
(-[WKDataListSuggestionsDropdown _showSuggestions]):

Canonical link: https://commits.webkit.org/310733@main



To unsubscribe from these emails, change your notification settings at 
https://github.com/WebKit/WebKit/settings/notifications

Reply via email to