Branch: refs/heads/main
Home: https://github.com/WebKit/WebKit
Commit: 9d4d4d7df6eeb3a50ce7749a4e47e1328a7a6a32
https://github.com/WebKit/WebKit/commit/9d4d4d7df6eeb3a50ce7749a4e47e1328a7a6a32
Author: Tim Horton <[email protected]>
Date: 2026-04-02 (Thu, 02 Apr 2026)
Changed paths:
A
LayoutTests/fast/forms/select-listbox-onchange-fired-on-mouseup-outside-expected.txt
A
LayoutTests/fast/forms/select-listbox-onchange-fired-on-mouseup-outside.html
M
LayoutTests/fast/forms/select/multiselect-in-listbox-mouse-release-outside-expected.txt
M LayoutTests/platform/ios/TestExpectations
M Source/WebCore/html/HTMLSelectElement.cpp
M Source/WebCore/html/HTMLSelectElement.h
Log Message:
-----------
<select multiple> does not always fire onchange when the mouse button is
released far outside the element
https://bugs.webkit.org/show_bug.cgi?id=311285
rdar://173882861
Reviewed by Aditya Keerthi.
When doing a multiple-select drag in a <select multiple>, we currently send
the `onchange` event in two cases:
- when `mouseup` fires on the <select>, and autoscrolling is not engaged
- when the autoscroll completes
However, we fail to send `onchange` in the case where:
- the `mouseup` is not dispatched to the <select> because the mouse is moved
significantly (e.g. out of the view)
AND
- we do not start autoscrolling, because the select is not scrollable
This results in a somewhat flaky-feeling behavior on some sites, because the
selection itself is updated live, during the drag, but the client is not
informed.
To fix this, have the <select> capture mouse events during the drag, so that it
always gets the `mouseup` and sends `onchange`.
Test: fast/forms/select-listbox-onchange-fired-on-mouseup-outside.html
*
LayoutTests/fast/forms/select-listbox-onchange-fired-on-mouseup-outside-expected.txt:
Added.
* LayoutTests/fast/forms/select-listbox-onchange-fired-on-mouseup-outside.html:
Added.
*
LayoutTests/fast/forms/select/multiselect-in-listbox-mouse-release-outside-expected.txt:
* LayoutTests/platform/ios/TestExpectations:
* Source/WebCore/html/HTMLSelectElement.cpp:
(WebCore::HTMLSelectElement::menuListDefaultEventHandler):
* Source/WebCore/html/HTMLSelectElement.h:
Canonical link: https://commits.webkit.org/310482@main
To unsubscribe from these emails, change your notification settings at
https://github.com/WebKit/WebKit/settings/notifications