Skip to content

Enhanced <select>: toggle picker on mousedown#59085

Merged
webkit-commit-queue merged 1 commit intoWebKit:mainfrom
annevk:eng/Enhanced-select-toggle-picker-on-mousedown
Feb 20, 2026
Merged

Enhanced <select>: toggle picker on mousedown#59085
webkit-commit-queue merged 1 commit intoWebKit:mainfrom
annevk:eng/Enhanced-select-toggle-picker-on-mousedown

Conversation

@annevk
Copy link
Contributor

@annevk annevk commented Feb 20, 2026

7b7f263

Enhanced <select>: toggle picker on mousedown
https://bugs.webkit.org/show_bug.cgi?id=308296
rdar://170742798

Reviewed by Tim Nguyen.

appearance: base-select ::picker(select) appears below a <select> by
default and as such clicking the <select> is expected to close it. This
also happens for normal <select>s on macOS as a side effect of how the
OS picker works.

To distinguish a click on the <select>'s "button" from a click anywhere
on ::picker(select) some composed tree traversal is necessary
unfortunately.

We also add some early returns for the different event types for
clarity.

What appears as a regression in select-events-2.optional.html is
actually a progression as before we did not get into a state where it
could fail. Both of the failures in that test are due to
preventDefault() being called in a microtask which at least in
combination with WebKit's test runner does not happen at the right
point in time.

select-popover-exit-animation.html likewise did not get into a state
where it could fail before.

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

9e8bdd2

Misc iOS, visionOS, tvOS & watchOS macOS Linux Windows Apple Internal
✅ 🧪 style ❌ 🛠 ios 🛠 mac 🛠 wpe 🛠 win ⏳ 🛠 ios-apple
✅ 🧪 bindings 🛠 ios-sim ✅ 🛠 mac-AS-debug 🧪 wpe-wk2 🧪 win-tests ⏳ 🛠 mac-apple
✅ 🧪 webkitperl 🧪 ios-wk2 🧪 api-mac 🧪 api-wpe ⏳ 🛠 vision-apple
🧪 ios-wk2-wpt 🧪 api-mac-debug 🛠 gtk3-libwebrtc
🧪 api-ios 🧪 mac-wk1 ✅ 🛠 gtk
🛠 ios-safer-cpp 🧪 mac-wk2 🧪 gtk-wk2
🛠 vision 🧪 mac-AS-debug-wk2 🧪 api-gtk
🛠 vision-sim 🧪 mac-wk2-stress 🛠 playstation
✅ 🛠 🧪 unsafe-merge ⏳ 🧪 vision-wk2 🧪 mac-intel-wk2
🛠 tv 🛠 mac-safer-cpp
🛠 tv-sim
🛠 watch
✅ 🛠 watch-sim

@annevk annevk requested review from cdumez and rniwa as code owners February 20, 2026 14:11
@annevk annevk self-assigned this Feb 20, 2026
@annevk annevk added the Forms For bugs specific to form elements (checkboxes, buttons, text fields, etc.) label Feb 20, 2026
@annevk annevk force-pushed the eng/Enhanced-select-toggle-picker-on-mousedown branch from 6c735f9 to 9e8bdd2 Compare February 20, 2026 17:30
@annevk annevk added the unsafe-merge-queue Applied to send a pull request to merge-queue, but skip building and testing label Feb 20, 2026
https://bugs.webkit.org/show_bug.cgi?id=308296
rdar://170742798

Reviewed by Tim Nguyen.

appearance: base-select ::picker(select) appears below a <select> by
default and as such clicking the <select> is expected to close it. This
also happens for normal <select>s on macOS as a side effect of how the
OS picker works.

To distinguish a click on the <select>'s "button" from a click anywhere
on ::picker(select) some composed tree traversal is necessary
unfortunately.

We also add some early returns for the different event types for
clarity.

What appears as a regression in select-events-2.optional.html is
actually a progression as before we did not get into a state where it
could fail. Both of the failures in that test are due to
preventDefault() being called in a microtask which at least in
combination with WebKit's test runner does not happen at the right
point in time.

select-popover-exit-animation.html likewise did not get into a state
where it could fail before.

Canonical link: https://commits.webkit.org/307925@main
@webkit-commit-queue webkit-commit-queue force-pushed the eng/Enhanced-select-toggle-picker-on-mousedown branch from 9e8bdd2 to 7b7f263 Compare February 20, 2026 17:32
@webkit-commit-queue
Copy link
Collaborator

Committed 307925@main (7b7f263): https://commits.webkit.org/307925@main

Reviewed commits have been landed. Closing PR #59085 and removing active labels.

@webkit-commit-queue webkit-commit-queue merged commit 7b7f263 into WebKit:main Feb 20, 2026
@webkit-commit-queue webkit-commit-queue removed the unsafe-merge-queue Applied to send a pull request to merge-queue, but skip building and testing label Feb 20, 2026
@annevk annevk deleted the eng/Enhanced-select-toggle-picker-on-mousedown branch February 20, 2026 17:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Forms For bugs specific to form elements (checkboxes, buttons, text fields, etc.)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants