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

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: SpinButton change event trigger 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
« no previous file with comments | « Source/core/html/shadow/SpinButtonElement.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..199e8e1f05614bf8f83ca720c74627c98568d14d 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_isMouseEvent(false)
, m_upDownState(Indeterminate)
, m_pressStartingState(Indeterminate)
, m_repeatingTimer(this, &SpinButtonElement::repeatingTimerFired)
@@ -87,7 +88,7 @@ void SpinButtonElement::defaultEventHandler(Event* event)
HTMLDivElement::defaultEventHandler(event);
return;
}
-
+ m_isMouseEvent = true;
MouseEvent* mouseEvent = toMouseEvent(event);
IntPoint local = roundedIntPoint(box->absoluteToLocal(mouseEvent->absoluteLocation(), UseTransforms));
if (mouseEvent->type() == EventTypeNames::mousedown && mouseEvent->button() == LeftButton) {
@@ -198,8 +199,10 @@ void SpinButtonElement::releaseCapture()
if (Page* page = document().page())
page->chrome().unregisterPopupOpeningObserver(this);
}
- if (m_spinButtonOwner)
- m_spinButtonOwner->spinButtonDidReleaseMouseCapture();
+ }
+ if (m_spinButtonOwner && m_isMouseEvent) {
+ m_spinButtonOwner->spinButtonDidReleaseMouseCapture();
+ m_isMouseEvent = false;
}
}
« no previous file with comments | « Source/core/html/shadow/SpinButtonElement.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698