Changeset 152330 in webkit
- Timestamp:
- Jul 2, 2013 5:20:03 PM (11 years ago)
- Location:
- trunk
- Files:
-
- 2 added
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r152322 r152330 1 2013-07-02 Ruth Fong <ruth_fong@apple.com> 2 3 Change event should not be dispatched by clicking a scrollbar of select listbox 4 https://bugs.webkit.org/show_bug.cgi?id=118019 5 <rdar://problem/14297760> 6 7 Reviewed by Dean Jackson. 8 9 Merge the following: 10 http://src.chromium.org/viewvc/blink?view=revision&revision=151689 11 https://chromium.googlesource.com/chromium/blink/+/492549b0fcaa58a85aa0797446b62985a263704f 12 13 * fast/forms/select/listbox-click-on-scrollbar-expected.txt: Added. 14 * fast/forms/select/listbox-click-on-scrollbar.html: Added. 15 Tests that an onChange() event is not fired when the scrollbar of a 16 <select multiple> element is clicked. 17 1 18 2013-07-02 David Farler <dfarler@apple.com> 2 19 -
trunk/Source/WebCore/ChangeLog
r152329 r152330 1 2013-07-02 Ruth Fong <ruth_fong@apple.com> 2 3 Change event should not be dispatched by clicking a scrollbar of select listbox 4 https://bugs.webkit.org/show_bug.cgi?id=118019 5 <rdar://problem/14297760> 6 7 Reviewed by Dean Jackson. 8 9 Test: fast/forms/select/listbox-click-on-scrollbar.html 10 11 Merge the following: 12 http://src.chromium.org/viewvc/blink?view=revision&revision=151689 13 https://chromium.googlesource.com/chromium/blink/+/492549b0fcaa58a85aa0797446b62985a263704f 14 15 Previously, a select element with the multiple attribute would dispatch 16 an onChanged event when the scrollbar is clicked. This patch corrects this 17 issue by only calling listBoxOnChange(), which fires the onChanged event, 18 when an actual option is clicked. 19 20 * html/HTMLSelectElement.cpp: 21 (WebCore::HTMLSelectElement::childrenChanged): Updated to clear the list 22 of selected items when when an <option> element is added to/deleted from its <select> element. 23 (Without this addition, if a option was selected, and then JavaScript was used to modify 24 the <select> element, and then the scrollbar was clicked, an onChanged event would fire 25 because it remembers the previously selected option.) 26 27 (WebCore::HTMLSelectElement::listBoxOnChange): 28 29 (WebCore::HTMLSelectElement::listBoxDefaultEventHandler): Updated to 30 only call listBoxOnChange() if at least one option is selected. 31 1 32 2013-07-02 Alex Christensen <achristensen@apple.com> 2 33 -
trunk/Source/WebCore/html/HTMLSelectElement.cpp
r152211 r152330 375 375 setRecalcListItems(); 376 376 setNeedsValidityCheck(); 377 m_lastOnChangeSelection.clear(); 377 378 378 379 HTMLFormControlElementWithState::childrenChanged(changedByParser, beforeChange, afterChange, childCountDelta); … … 1348 1349 } 1349 1350 } else if (event->type() == eventNames().mouseupEvent && event->isMouseEvent() && static_cast<MouseEvent*>(event)->button() == LeftButton && document()->frame()->eventHandler()->autoscrollRenderer() != renderer()) { 1351 // This click or drag event was not over any of the options. 1352 if (m_lastOnChangeSelection.isEmpty()) 1353 return; 1350 1354 // This makes sure we fire dispatchFormControlChangeEvent for a single 1351 1355 // click. For drag selection, onChange will fire when the autoscroll
Note: See TracChangeset
for help on using the changeset viewer.