Bug 118019

Summary: Change event should not be dispatched by clicking a scrollbar of select listbox
Product: WebKit Reporter: Ryosuke Niwa <rniwa>
Component: FormsAssignee: Nobody <webkit-unassigned>
Status: RESOLVED FIXED    
Severity: Normal CC: commit-queue, dino, jonlee, ruthiecftg, tkent, webkit-bug-importer
Priority: P2 Keywords: BlinkMergeCandidate, InRadar
Version: 528+ (Nightly build)   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
Patch
none
test file
none
Test file to repro size change bug
none
Patch
none
Archive of layout-test-results from APPLE-EWS-2 for win-future
none
Patch none

Ryosuke Niwa
Reported 2013-06-25 20:22:53 PDT
Consider merging https://chromium.googlesource.com/chromium/blink/+/492549b0fcaa58a85aa0797446b62985a263704f We fixed crbug.com/244406, but the fix was incomplete. Bug detail: If the size of option list is changed after the last 'change' event and 'mouseup' happens on the scrollbar, new 'change' event is dispatched even though the selection state is not changed. HTMLSelectElement::listBoxOnChange dispatches 'change' event if m_lastOnChangeSelection.size() is different from the option list size. (Why?) How to fix: When the option list size is changed, we should update m_lastOnChangeSelection so that it represents reality or should avoid to call listBoxOnChange() in mouseup event handler. This patch implements the latter by clearing m_lastOnChangeSelection.
Attachments
Patch (6.13 KB, patch)
2013-06-28 16:23 PDT, Ruth Fong
no flags
test file (649 bytes, text/html)
2013-06-28 16:27 PDT, Ruth Fong
no flags
Test file to repro size change bug (873 bytes, text/html)
2013-07-01 15:31 PDT, Ruth Fong
no flags
Patch (7.44 KB, patch)
2013-07-01 16:47 PDT, Ruth Fong
no flags
Archive of layout-test-results from APPLE-EWS-2 for win-future (832.45 KB, application/zip)
2013-07-02 15:17 PDT, Build Bot
no flags
Patch (7.50 KB, patch)
2013-07-02 16:07 PDT, Ruth Fong
no flags
Radar WebKit Bug Importer
Comment 1 2013-06-27 16:56:31 PDT
Ruth Fong
Comment 2 2013-06-28 16:23:18 PDT
Ruth Fong
Comment 3 2013-06-28 16:27:19 PDT
Created attachment 205754 [details] test file With patch 205753 alone, I haven't been able to repro the issue of a change event firing after a change event and a change to size of the select list. (I click an option, then the button, and then the scrollbar and can't get the onChange event to fire). Yet, when I run Chromium's layout test, I can hit the case and fail at line 47 with changeEventCounter = 2. (https://chromium.googlesource.com/chromium/blink/+/492549b0fcaa58a85aa0797446b62985a263704f/LayoutTests/fast/forms/select/listbox-click-on-scrollbar.html) Any ideas how to manually repro this situation?
Kent Tamura
Comment 4 2013-06-30 16:55:35 PDT
Ruth Fong
Comment 5 2013-07-01 15:31:34 PDT
Created attachment 205841 [details] Test file to repro size change bug
Ruth Fong
Comment 6 2013-07-01 16:47:13 PDT
Build Bot
Comment 7 2013-07-02 15:17:44 PDT
Comment on attachment 205843 [details] Patch Attachment 205843 [details] did not pass win-ews (win): Output: http://webkit-queues.appspot.com/results/1022028 New failing tests: fast/js/global-constructors-attributes-shared-worker.html fast/forms/select/popup-closes-on-blur.html fast/media/mq-transform-03.html editing/selection/user-select-all-image-with-single-click.html fast/forms/search-event-delay.html fast/js/global-constructors-attributes-dedicated-worker.html editing/selection/user-select-all-with-single-click.html fast/media/mq-transform-02.html platform/win/accessibility/multiple-select-element-role.html
Build Bot
Comment 8 2013-07-02 15:17:46 PDT
Created attachment 205947 [details] Archive of layout-test-results from APPLE-EWS-2 for win-future The attached test failures were seen while running run-webkit-tests on the win-ews. Bot: APPLE-EWS-2 Port: win-future Platform: CYGWIN_NT-6.1-WOW64-1.7.20-0.266-5-3-i686-32bit
Dean Jackson
Comment 9 2013-07-02 15:29:08 PDT
Comment on attachment 205843 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=205843&action=review > Source/WebCore/html/HTMLSelectElement.cpp:1351 > + // This click or drag event was not over any of the options Nit. End the comment with a full-stop/period.
Ruth Fong
Comment 10 2013-07-02 16:07:50 PDT
WebKit Commit Bot
Comment 11 2013-07-02 17:20:46 PDT
Comment on attachment 205956 [details] Patch Clearing flags on attachment: 205956 Committed r152330: <http://trac.webkit.org/changeset/152330>
WebKit Commit Bot
Comment 12 2013-07-02 17:20:48 PDT
All reviewed patches have been landed. Closing bug.
Kent Tamura
Comment 13 2013-07-02 18:11:35 PDT
*** Bug 117431 has been marked as a duplicate of this bug. ***
Note You need to log in before you can comment on or make changes to this bug.