Branch: refs/heads/main
Home: https://github.com/WebKit/WebKit
Commit: eeb3a544b0f7900cb975046dd78153c268bbfcb2
https://github.com/WebKit/WebKit/commit/eeb3a544b0f7900cb975046dd78153c268bbfcb2
Author: Anne van Kesteren <[email protected]>
Date: 2026-09-25 (Fri, 25 Sep 2026)
Changed paths:
M
LayoutTests/imported/w3c/web-platform-tests/html/semantics/forms/the-select-element/customizable-select/select-click-drag-option.optional-expected.txt
A
LayoutTests/imported/w3c/web-platform-tests/html/semantics/forms/the-select-element/customizable-select/select-pick-option-keydown-expected.txt
A
LayoutTests/imported/w3c/web-platform-tests/html/semantics/forms/the-select-element/customizable-select/select-pick-option-keydown.html
A
LayoutTests/imported/w3c/web-platform-tests/html/semantics/forms/the-select-element/customizable-select/select-picker-hover-after-picking-expected.txt
A
LayoutTests/imported/w3c/web-platform-tests/html/semantics/forms/the-select-element/customizable-select/select-picker-hover-after-picking.html
A
LayoutTests/imported/w3c/web-platform-tests/html/semantics/forms/the-select-element/customizable-select/select-picker-option-hover-while-dragging.optional-expected.txt
A
LayoutTests/imported/w3c/web-platform-tests/html/semantics/forms/the-select-element/customizable-select/select-picker-option-hover-while-dragging.optional.html
M
LayoutTests/imported/w3c/web-platform-tests/html/semantics/forms/the-select-element/customizable-select/w3c-import.log
A
LayoutTests/imported/w3c/web-platform-tests/html/semantics/popovers/popover-hover-active-ancestors-expected.txt
A
LayoutTests/imported/w3c/web-platform-tests/html/semantics/popovers/popover-hover-active-ancestors.html
M
LayoutTests/imported/w3c/web-platform-tests/html/semantics/popovers/w3c-import.log
M LayoutTests/platform/ios/TestExpectations
A
LayoutTests/platform/ios/imported/w3c/web-platform-tests/html/semantics/forms/the-select-element/customizable-select/select-pick-option-keydown-expected.txt
M Source/WebCore/animation/StyleOriginatedTimelinesController.cpp
M Source/WebCore/dom/Document.cpp
M Source/WebCore/dom/Element.cpp
M Source/WebCore/dom/Node.h
M Source/WebCore/html/HTMLDialogElement.cpp
M Source/WebCore/html/HTMLOptionElement.cpp
M Source/WebCore/html/HTMLSelectElement.cpp
M Source/WebCore/html/HTMLSelectElement.h
Log Message:
-----------
Pick a select option on mouseup and keydown
https://bugs.webkit.org/show_bug.cgi?id=324985
Reviewed by Ryosuke Niwa.
We are currently using mousedown and keypress. mousedown is problematic because
it does not allow one to press the select and then drag towards an option and
release to pick it.
Aside from that, mouseup and keydown are what the specification asks for.
Moving to keydown means checking the modifiers, which the keypress path got for
free because it's not dispatched when Command or Control is down and
Option-Space would generate a different code.
While looking into this we also found three hover bugs.
While a button is held, hover only changes within the chain frozen at
mousedown. The picker does not exist yet at that point, so its options could
never match :hover. The freeze now skips a top layer subtree that was not in
the frozen chain, per element, so the option unhovers again on the way out.
Element::addToTopLayer() and removeFromTopLayer() tested contains(), which
walks the node tree, while the propagation it guards walks the composed tree.
Slotted content, such as an option in the picker, therefore never got :hover
and :active back when the popover hid.
Document::hoveredElementDidDetach() and elementInActiveChainDidDetach()
retargeted through the node tree as well, landing outside the popover on an
element that was never hovered or active. Releasing the pointer then left
:active on the popover, as clearing it walks the composed lineage of the
retargeted element. Both now walk the composed tree. The common ancestor is
also required to be hovered, which is what the hover loops assume.
Space and return still open the picker on keypress; left alone because that
path is shared with the native dropdown box.
Tests:
imported/w3c/web-platform-tests/html/semantics/forms/the-select-element/customizable-select/select-pick-option-keydown.html
imported/w3c/web-platform-tests/html/semantics/forms/the-select-element/customizable-select/select-picker-hover-after-picking.html
imported/w3c/web-platform-tests/html/semantics/forms/the-select-element/customizable-select/select-picker-option-hover-while-dragging.optional.html
imported/w3c/web-platform-tests/html/semantics/popovers/popover-hover-active-ancestors.html
Canonical link: https://commits.webkit.org/321891@main
To unsubscribe from these emails, change your notification settings at
https://github.com/WebKit/WebKit/settings/notifications