Branch: refs/heads/main
Home: https://github.com/WebKit/WebKit
Commit: c0123530ab81dcf7d807eaa84e00adbf5655bd9b
https://github.com/WebKit/WebKit/commit/c0123530ab81dcf7d807eaa84e00adbf5655bd9b
Author: Anne van Kesteren <[email protected]>
Date: 2026-10-11 (Sun, 11 Oct 2026)
Changed paths:
M
LayoutTests/accessibility/isolated-tree/mac/listbox-option-set-selected-expected.txt
M
LayoutTests/accessibility/isolated-tree/mac/listbox-option-set-selected.html
M
LayoutTests/accessibility/isolated-tree/mac/listbox-selected-children-changed-expected.txt
M
LayoutTests/accessibility/isolated-tree/mac/listbox-selected-children-changed.html
M LayoutTests/accessibility/mac/listbox-option-set-selected-expected.txt
M LayoutTests/accessibility/mac/listbox-option-set-selected.html
M
LayoutTests/accessibility/mac/listbox-selected-children-changed-expected.txt
M LayoutTests/accessibility/mac/listbox-selected-children-changed.html
M LayoutTests/fast/forms/select/base/select-listbox-expected.txt
M LayoutTests/fast/forms/select/base/select-listbox.html
M
LayoutTests/imported/w3c/web-platform-tests/html/semantics/forms/the-select-element/customizable-select-listbox/customizable-select-listbox-mouse-behavior.html
A
LayoutTests/imported/w3c/web-platform-tests/html/semantics/interactive-elements/commands/option/option-accesskey-expected.txt
A
LayoutTests/imported/w3c/web-platform-tests/html/semantics/interactive-elements/commands/option/option-accesskey.html
A
LayoutTests/imported/w3c/web-platform-tests/html/semantics/interactive-elements/commands/option/w3c-import.log
M LayoutTests/platform/ios/TestExpectations
M Source/WebCore/html/HTMLOptionElement.cpp
M Source/WebCore/html/HTMLSelectElement.cpp
M Source/WebCore/html/HTMLSelectElement.h
Log Message:
-----------
Picking the selected option of a single-select deselects it
https://bugs.webkit.org/show_bug.cgi?id=327130
rdar://189733206
Reviewed by Ryosuke Niwa.
The pick an option algorithm only sets the selectedness of an option to true,
so users cannot
deselect the option of a single-select, as with a native list box. Yet
activating the selected
option of a base appearance single-select list box deselected it, and so did
assistive technology
there. The HTML standard defines the access key of an option to pick it, or
toggle it in a select
with multiple, but unless the select had a base appearance picker it went
through
HTMLSelectElement::accessKeySetSelectedIndex(), which toggled it in any select.
That also left the
selectedOptions collection stale, and focused and clicked the select first.
Remove the deselection from pickOrToggleOption(), and have
HTMLOptionElement::accessKeyAction() and
HTMLOptionElement::setSelectedByUser() use it regardless of appearance, so that
accessKeySetSelectedIndex() can go. pickOrToggleOption() now only hides a base
appearance picker.
pickOrToggleOption() still only sets the dirtiness of the option for base
appearance. Picking and
toggling set it regardless of appearance, but no native user interaction sets
it yet, not the
native popup nor mouse and keyboard input, so neither should the access key or
assistive
technology. Setting it for all of native appearance is left for a separate
change.
customizable-select-listbox-mouse-behavior.html expected the deselection, so
update it.
Test:
imported/w3c/web-platform-tests/html/semantics/interactive-elements/commands/option/option-accesskey.html
Canonical link: https://commits.webkit.org/323382@main
To unsubscribe from these emails, change your notification settings at
https://github.com/WebKit/WebKit/settings/notifications