Bug 76244 - REGRESSION(r100111): A 'change' event does not fire when a mouse drag occurs to switch elements in a listbox
Summary: REGRESSION(r100111): A 'change' event does not fire when a mouse drag occurs ...
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Forms (show other bugs)
Version: 528+ (Nightly build)
Hardware: All All
: P1 Normal
Assignee: Kent Tamura
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-01-12 21:16 PST by Kent Tamura
Modified: 2012-01-18 22:52 PST (History)
5 users (show)

See Also:


Attachments
Patch (6.02 KB, patch)
2012-01-17 22:35 PST, Kent Tamura
no flags Details | Formatted Diff | Diff
Patch for landing (6.71 KB, patch)
2012-01-18 18:30 PST, Kent Tamura
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Kent Tamura 2012-01-12 21:16:15 PST
Reported at http://code.google.com/p/chromium/issues/detail?id=110068.


<select id="sel1" size="4" onchange="alert('event fired: ' + document.getElementById('sel1').value);">
<option>RED</option>
<option>GREEN</option>
<option>BLUE</option>
<option>YELLOW</option>
</select>

If you select an option by mouse dragging (not clicking), 'change' event doesn't fire. This problem was made by r99667 or r100111.
Comment 1 Kent Tamura 2012-01-17 20:43:22 PST
The root cause is that the mousedown handling in listBoxDefaultEventHandler() updates m_lastOnChangeSelection. If the listbox is scrollable, mousemove events are not dispatched.
Comment 2 Kent Tamura 2012-01-17 22:35:18 PST
Created attachment 122874 [details]
Patch
Comment 3 Hajime Morrita 2012-01-17 22:51:58 PST
Comment on attachment 122874 [details]
Patch

The test shows the evidence.
Comment 4 Kent Tamura 2012-01-17 23:09:15 PST
(In reply to comment #1)
> The root cause is that the mousedown handling in listBoxDefaultEventHandler() updates m_lastOnChangeSelection. If the listbox is scrollable, mousemove events are not dispatched.

Correction: mousedown -> mousemove

BTW, HTMLSelectElement has multiple functions to update option selection, and they are confusing. We had better refactor/rename/document them.
Comment 5 WebKit Review Bot 2012-01-17 23:27:33 PST
Comment on attachment 122874 [details]
Patch

Attachment 122874 [details] did not pass chromium-ews (chromium-xvfb):
Output: http://queues.webkit.org/results/11282082

New failing tests:
fast/forms/select-multiple-elements-with-mouse-drag-with-options-less-than-size.html
Comment 6 Kent Tamura 2012-01-18 02:21:28 PST
(In reply to comment #5)
> (From update of attachment 122874 [details])
> Attachment 122874 [details] did not pass chromium-ews (chromium-xvfb):
> Output: http://queues.webkit.org/results/11282082
> 
> New failing tests:
> fast/forms/select-multiple-elements-with-mouse-drag-with-options-less-than-size.html

The test didn't fail on Apple Mac and Chromium Mac with the patch.
Comment 7 Kent Tamura 2012-01-18 18:30:52 PST
Created attachment 123050 [details]
Patch for landing
Comment 8 WebKit Review Bot 2012-01-18 22:52:12 PST
Comment on attachment 123050 [details]
Patch for landing

Clearing flags on attachment: 123050

Committed r105386: <http://trac.webkit.org/changeset/105386>
Comment 9 WebKit Review Bot 2012-01-18 22:52:17 PST
All reviewed patches have been landed.  Closing bug.