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

Unified Diff: Source/core/html/shadow/SpinButtonElement.cpp

Issue 144713007: Spinner elements not to dispatch change event on hover (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Set change event details before dispatching event Created 6 years, 10 months 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/shadow/SpinButtonElement.cpp
diff --git a/Source/core/html/shadow/SpinButtonElement.cpp b/Source/core/html/shadow/SpinButtonElement.cpp
index 04e21b86af6f1ea332e91be804b0b1b0519bbc43..7f1e90c79a2980ec267c4b4934571a3615cfad49 100644
--- a/Source/core/html/shadow/SpinButtonElement.cpp
+++ b/Source/core/html/shadow/SpinButtonElement.cpp
@@ -47,6 +47,7 @@ inline SpinButtonElement::SpinButtonElement(Document& document, SpinButtonOwner&
: HTMLDivElement(document)
, m_spinButtonOwner(&spinButtonOwner)
, m_capturing(false)
+ , m_mouseUpEvent(false)
, m_upDownState(Indeterminate)
, m_pressStartingState(Indeterminate)
, m_repeatingTimer(this, &SpinButtonElement::repeatingTimerFired)
@@ -112,6 +113,7 @@ void SpinButtonElement::defaultEventHandler(Event* event)
event->setDefaultHandled();
}
} else if (mouseEvent->type() == EventTypeNames::mouseup && mouseEvent->button() == LeftButton) {
+ m_mouseUpEvent = true;
tkent 2014/02/07 08:58:17 This means we call dispatchFormControlChangeEvent
releaseCapture();
} else if (event->type() == EventTypeNames::mousemove) {
if (box->pixelSnappedBorderBoxRect().contains(local)) {
@@ -198,8 +200,10 @@ void SpinButtonElement::releaseCapture()
if (Page* page = document().page())
page->chrome().unregisterPopupOpeningObserver(this);
}
- if (m_spinButtonOwner)
- m_spinButtonOwner->spinButtonDidReleaseMouseCapture();
+ }
+ if (m_spinButtonOwner && m_mouseUpEvent) {
+ m_spinButtonOwner->spinButtonDidReleaseMouseCapture();
+ m_mouseUpEvent = false;
}
}

Powered by Google App Engine
This is Rietveld 408576698