Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1010)

Unified Diff: Source/core/html/HTMLSelectElement.cpp

Issue 120373005: OnChange event should fire if the multiple selection changes in listbox using mouse (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: removed unnecessary blank lines in layout test Created 7 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: Source/core/html/HTMLSelectElement.cpp
diff --git a/Source/core/html/HTMLSelectElement.cpp b/Source/core/html/HTMLSelectElement.cpp
old mode 100644
new mode 100755
index 2d581071d37568b86dd674a14514976a284ad179..05c87eac811ee69e761559771f64b80df9567b6d
--- a/Source/core/html/HTMLSelectElement.cpp
+++ b/Source/core/html/HTMLSelectElement.cpp
@@ -74,6 +74,7 @@ HTMLSelectElement::HTMLSelectElement(Document& document, HTMLFormElement* form,
, m_activeSelectionState(false)
, m_shouldRecalcListItems(false)
, m_isParsingInProgress(createdByParser)
+ , m_onChangeFired(true)
eseidel 2013/12/28 19:57:00 When the element is created the "on change" has al
gnana 2014/01/03 07:50:02 In my latest patch i dont use it any more so i rem
{
ScriptWrappable::init(this);
}
@@ -1300,6 +1301,7 @@ void HTMLSelectElement::listBoxDefaultEventHandler(Event* event)
frame->eventHandler().setMouseDownMayStartAutoscroll();
event->setDefaultHandled();
+ setOnChangeFired(false);
}
} else if (event->type() == EventTypeNames::mousemove && event->isMouseEvent() && !toRenderBox(renderer())->canBeScrolledAndHasScrollableArea()) {
MouseEvent* mouseEvent = toMouseEvent(event);
@@ -1323,7 +1325,7 @@ void HTMLSelectElement::listBoxDefaultEventHandler(Event* event)
updateListBoxSelection(true);
}
}
- event->setDefaultHandled();
+ // event->setDefaultHandled();
eseidel 2013/12/28 19:57:00 Please don't commit commented out code.
gnana 2014/01/03 07:50:02 Done.
}
} else if (event->type() == EventTypeNames::mouseup && event->isMouseEvent() && toMouseEvent(event)->button() == LeftButton && renderer() && !toRenderBox(renderer())->autoscrollInProgress()) {
// We didn't start this click/drag on any options.
@@ -1332,7 +1334,10 @@ void HTMLSelectElement::listBoxDefaultEventHandler(Event* event)
// This makes sure we fire dispatchFormControlChangeEvent for a single
// click. For drag selection, onChange will fire when the autoscroll
// timer stops.
- listBoxOnChange();
+ if (!isOnChangeFired()) {
+ setOnChangeFired(true);
+ listBoxOnChange();
+ }
} else if (event->type() == EventTypeNames::keydown) {
if (!event->isKeyboardEvent())
return;

Powered by Google App Engine
This is Rietveld 408576698