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

Unified Diff: Source/core/page/EventHandler.cpp

Issue 831393003: Plumb hasPreciseScrollingDeltas into ScrollGranularity for overflow scrolls. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Remove testRunner.dumpAsText() Created 5 years, 11 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/events/WheelEvent.cpp ('k') | Source/web/tests/WebInputEventConversionTest.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/page/EventHandler.cpp
diff --git a/Source/core/page/EventHandler.cpp b/Source/core/page/EventHandler.cpp
index 9a76e6ebcaae7f80346e80340cb3bcfc03fc110b..aa01d165402f1bbde68710b31ade02ef09969c53 100644
--- a/Source/core/page/EventHandler.cpp
+++ b/Source/core/page/EventHandler.cpp
@@ -172,18 +172,15 @@ private:
double m_start;
};
-static inline ScrollGranularity wheelGranularityToScrollGranularity(unsigned deltaMode)
+static inline ScrollGranularity wheelGranularityToScrollGranularity(WheelEvent* event)
{
- switch (deltaMode) {
- case WheelEvent::DOM_DELTA_PAGE:
+ unsigned deltaMode = event->deltaMode();
+ if (deltaMode == WheelEvent::DOM_DELTA_PAGE)
return ScrollByPage;
- case WheelEvent::DOM_DELTA_LINE:
+ if (deltaMode == WheelEvent::DOM_DELTA_LINE)
return ScrollByLine;
- case WheelEvent::DOM_DELTA_PIXEL:
- return ScrollByPixel;
- default:
- return ScrollByPixel;
- }
+ ASSERT(deltaMode == WheelEvent::DOM_DELTA_PIXEL);
+ return event->hasPreciseScrollingDeltas() ? ScrollByPrecisePixel : ScrollByPixel;
}
// Refetch the event target node if it is removed or currently is the shadow node inside an <input> element.
@@ -2044,7 +2041,7 @@ void EventHandler::defaultWheelEventHandler(Node* startNode, WheelEvent* wheelEv
return;
Node* stopNode = m_previousWheelScrolledNode.get();
- ScrollGranularity granularity = wheelGranularityToScrollGranularity(wheelEvent->deltaMode());
+ ScrollGranularity granularity = wheelGranularityToScrollGranularity(wheelEvent);
// Break up into two scrolls if we need to. Diagonal movement on
// a MacBook pro is an example of a 2-dimensional mouse wheel event (where both deltaX and deltaY can be set).
« no previous file with comments | « Source/core/events/WheelEvent.cpp ('k') | Source/web/tests/WebInputEventConversionTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698