Bug 118019 - Change event should not be dispatched by clicking a scrollbar of select listbox
Summary: Change event should not be dispatched by clicking a scrollbar of select listbox
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Forms (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Nobody
URL:
Keywords: BlinkMergeCandidate, InRadar
: 117431 (view as bug list)
Depends on:
Blocks:
 
Reported: 2013-06-25 20:22 PDT by Ryosuke Niwa
Modified: 2013-07-02 18:11 PDT (History)
6 users (show)

See Also:


Attachments
Patch (6.13 KB, patch)
2013-06-28 16:23 PDT, Ruth Fong
no flags Details | Formatted Diff | Diff
test file (649 bytes, text/html)
2013-06-28 16:27 PDT, Ruth Fong
no flags Details
Test file to repro size change bug (873 bytes, text/html)
2013-07-01 15:31 PDT, Ruth Fong
no flags Details
Patch (7.44 KB, patch)
2013-07-01 16:47 PDT, Ruth Fong
no flags Details | Formatted Diff | Diff
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 Details
Patch (7.50 KB, patch)
2013-07-02 16:07 PDT, Ruth Fong
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Ryosuke Niwa 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.
Comment 1 Radar WebKit Bug Importer 2013-06-27 16:56:31 PDT
<rdar://problem/14297760>
Comment 2 Ruth Fong 2013-06-28 16:23:18 PDT
Created attachment 205753 [details]
Patch
Comment 3 Ruth Fong 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?
Comment 4 Kent Tamura 2013-06-30 16:55:35 PDT
(In reply to comment #3)
> 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)

You need to merge http://src.chromium.org/viewvc/blink?view=revision&revision=152868 too.
Comment 5 Ruth Fong 2013-07-01 15:31:34 PDT
Created attachment 205841 [details]
Test file to repro size change bug
Comment 6 Ruth Fong 2013-07-01 16:47:13 PDT
Created attachment 205843 [details]
Patch
Comment 7 Build Bot 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
Comment 8 Build Bot 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
Comment 9 Dean Jackson 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.
Comment 10 Ruth Fong 2013-07-02 16:07:50 PDT
Created attachment 205956 [details]
Patch
Comment 11 WebKit Commit Bot 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>
Comment 12 WebKit Commit Bot 2013-07-02 17:20:48 PDT
All reviewed patches have been landed.  Closing bug.
Comment 13 Kent Tamura 2013-07-02 18:11:35 PDT
*** Bug 117431 has been marked as a duplicate of this bug. ***