Chromium Code Reviews| Index: third_party/WebKit/Source/core/input/EventHandler.cpp |
| diff --git a/third_party/WebKit/Source/core/input/EventHandler.cpp b/third_party/WebKit/Source/core/input/EventHandler.cpp |
| index 47861ee82accc725137fb84ebbac9b5d1eb3bf63..131ab4313a92302de30861c2ad0436439428fab7 100644 |
| --- a/third_party/WebKit/Source/core/input/EventHandler.cpp |
| +++ b/third_party/WebKit/Source/core/input/EventHandler.cpp |
| @@ -2505,6 +2505,15 @@ WebInputEventResult EventHandler::handleGestureScrollUpdate(const PlatformGestur |
| if (delta.isZero()) |
| return WebInputEventResult::NotHandled; |
| + ScrollGranularity granularity = gestureEvent.deltaUnits(); |
| + |
| + if (granularity == ScrollByPage) { |
| + if (delta.width()) |
| + delta.setWidth(delta.width() > 0 ? 1 : -1); |
| + if (delta.height()) |
| + delta.setHeight(delta.height() > 0 ? 1 : -1); |
|
tdresser
2016/01/05 16:07:33
If a mousewheel is set to scroll by page, and we c
tdresser
2016/01/05 16:27:32
I didn't realize this was already the case.
Let's
dtapuska
2016/01/05 16:52:28
I'll move it to the time the gesture is generated;
dtapuska
2016/01/05 16:52:28
Acknowledged.
|
| + } |
| + |
| Node* node = m_scrollGestureHandlingNode.get(); |
| if (node) { |
| LayoutObject* layoutObject = node->layoutObject(); |
| @@ -2556,7 +2565,6 @@ WebInputEventResult EventHandler::handleGestureScrollUpdate(const PlatformGestur |
| stopNode = m_previousGestureScrolledNode.get(); |
| // First try to scroll the closest scrollable LayoutBox ancestor of |node|. |
| - ScrollGranularity granularity = ScrollByPrecisePixel; |
| ScrollResultOneDimensional result = scroll(ScrollLeftIgnoringWritingMode, granularity, node, &stopNode, delta.width()); |
| bool horizontalScroll = result.didScroll; |
| if (!gestureEvent.preventPropagation()) |
| @@ -2580,7 +2588,7 @@ WebInputEventResult EventHandler::handleGestureScrollUpdate(const PlatformGestur |
| return WebInputEventResult::NotHandled; |
| // Try to scroll the frame view. |
| - ScrollResult scrollResult = m_frame->applyScrollDelta(delta, false); |
| + ScrollResult scrollResult = m_frame->applyScrollDelta(granularity, delta, false); |
| FloatPoint position = FloatPoint(gestureEvent.position().x(), gestureEvent.position().y()); |
| FloatSize velocity = FloatSize(gestureEvent.velocityX(), gestureEvent.velocityY()); |
| handleOverscroll(scrollResult, position, velocity); |