Branch: refs/heads/main
Home: https://github.com/WebKit/WebKit
Commit: 6d2c9aa77f49d25795a747db20aba08138364ea7
https://github.com/WebKit/WebKit/commit/6d2c9aa77f49d25795a747db20aba08138364ea7
Author: Anne van Kesteren <[email protected]>
Date: 2026-10-13 (Tue, 13 Oct 2026)
Changed paths:
M
LayoutTests/accessibility/isolated-tree/mac/select-dropdown-box-value-expected.txt
M LayoutTests/accessibility/isolated-tree/mac/select-dropdown-box-value.html
M LayoutTests/accessibility/mac/select-dropdown-box-value-expected.txt
M LayoutTests/accessibility/mac/select-dropdown-box-value.html
M
LayoutTests/fast/forms/select/mac-wk2/select-multiple-dropdown-box-width-expected.txt
M
LayoutTests/fast/forms/select/mac-wk2/select-multiple-dropdown-box-width.html
A
LayoutTests/fast/forms/select/selectedcontent-multiple/button-text-expected.txt
A LayoutTests/fast/forms/select/selectedcontent-multiple/button-text.html
M Source/WebCore/html/HTMLSelectElement.cpp
M Source/WebCore/html/HTMLSelectElement.h
M Source/WebCore/rendering/RenderMenuList.cpp
Log Message:
-----------
The button text of a <select multiple> runs all its <selectedcontent> clones
together
https://bugs.webkit.org/show_bug.cgi?id=327386
rdar://189897712
Reviewed by Ryosuke Niwa.
With HTMLEnhancedSelectMultipleSelectedContentEnabled, a selectedcontent
element of a select element
with the multiple attribute holds a clone of every option, and the user agent
style sheet only
displays the clones that match :checked. HTMLSelectElement::buttonText()
collected the text of the
button including every clone, so with Cheese and Olives selected out of Cheese,
Ham, and Olives, a
"Toppings: <selectedcontent>" button gave "Toppings: CheeseHamOlives" for any
selection. Native
appearance renders that text since 322716@main, and since 323332@main it is the
accessibility value
of the dropdown box in either appearance.
For such a select, buttonText() now puts the text the select shows without a
button in place of its
selectedcontent elements: the label of the one selected option, or else the
number of selected
options. The button above gives "Toppings: 2 Items". A button without a
selectedcontent element still
gives its own text. Joining the labels of the selected options instead would
need a localized list
format, and would make a select with native appearance as wide as the labels of
all its options
together.
RenderMenuList::updateOptionsWidth() now measures each count within the button
text, as it already
did each label.
Test: fast/forms/select/selectedcontent-multiple/button-text.html
Canonical link: https://commits.webkit.org/323587@main
To unsubscribe from these emails, change your notification settings at
https://github.com/WebKit/WebKit/settings/notifications