Branch: refs/heads/main
Home: https://github.com/WebKit/WebKit
Commit: 9b7886d8647246fa88cd1634797c07bf231dce13
https://github.com/WebKit/WebKit/commit/9b7886d8647246fa88cd1634797c07bf231dce13
Author: Anne van Kesteren <[email protected]>
Date: 2026-10-05 (Mon, 05 Oct 2026)
Changed paths:
M
LayoutTests/fast/forms/select/base/select-box-type-follows-preferred-size-expected.txt
M
LayoutTests/fast/forms/select/base/select-box-type-follows-preferred-size.html
A
LayoutTests/fast/forms/select/mac-wk2/select-multiple-dropdown-box-appearance-expected.html
A
LayoutTests/fast/forms/select/mac-wk2/select-multiple-dropdown-box-appearance.html
A
LayoutTests/fast/forms/select/mac-wk2/select-multiple-dropdown-box-expected.txt
A
LayoutTests/fast/forms/select/mac-wk2/select-multiple-dropdown-box-width-expected.txt
A
LayoutTests/fast/forms/select/mac-wk2/select-multiple-dropdown-box-width.html
A LayoutTests/fast/forms/select/mac-wk2/select-multiple-dropdown-box.html
M LayoutTests/platform/ios/fast/forms/select-block-background-expected.txt
M LayoutTests/platform/mac/TestExpectations
M Source/WTF/Scripts/Preferences/UnifiedWebPreferences.yaml
M Source/WebCore/html/HTMLSelectElement.cpp
M Source/WebCore/html/HTMLSelectElement.h
M Source/WebCore/rendering/RenderMenuList.cpp
M Source/WebCore/rendering/RenderMenuList.h
M Source/WebCore/rendering/cocoa/RenderThemeCocoa.mm
M Source/WebKit/UIProcess/API/mac/WKWebViewTestingMac.mm
M Source/WebKit/UIProcess/mac/WebPopupMenuProxyMac.mm
M Tools/WebKitTestRunner/mac/UIScriptControllerMac.h
M Tools/WebKitTestRunner/mac/UIScriptControllerMac.mm
Log Message:
-----------
Render <select multiple size=1> as a dropdown box on macOS behind a preference
https://bugs.webkit.org/show_bug.cgi?id=325963
Reviewed by Abrar Rahman Protyasha and Aditya Keerthi.
HTML lets a select element with the multiple attribute and a preferred size of
1 render as a multi-select dropdown box where the platform supports it.
HTMLEnhancedSelectMultipleAndListBoxEnabled already does that for base
appearance. With that and the new HTMLEnhancedSelectMultipleDropdownBoxEnabled
enabled, macOS does it for native appearance too, using the native popup menu.
AppKit menus close once an item is chosen, so choosing an option toggles it and
closes the menu, like a pull-down button whose items toggle.
Unless exactly one option is selected, such a select shows a count of its
selected options, so make it wide enough for each count it can show. With
proportional digits a smaller count can be wider, so measuring the largest is
not enough. A select without options still shows a count, so size containment
keeps the width of that count rather than dropping to the minimum width. This
fix also applies to iOS, where every select element with the multiple attribute
is a dropdown box.
The vector-based controls of macOS 26 painted a select with multiple with the
three-dot glyph of iOS, where such a select opens a list in a sheet or popover
rather than a menu. Limit that glyph to iOS, so that on macOS the select has
the same chevrons as one without multiple, as it already had when styled.
To test this, WebKitTestRunner implements selectFormAccessoryPickerRow(),
selectFormAccessoryHasCheckedItemAtRow() and dismissFormAccessoryView() for the
select popup on macOS, and _activeMenu now returns the select popup's menu
while it is open.
Tests: fast/forms/select/mac-wk2/select-multiple-dropdown-box-appearance.html
fast/forms/select/mac-wk2/select-multiple-dropdown-box-width.html
fast/forms/select/mac-wk2/select-multiple-dropdown-box.html
Canonical link: https://commits.webkit.org/322796@main
To unsubscribe from these emails, change your notification settings at
https://github.com/WebKit/WebKit/settings/notifications