Commit aa27c866 authored by dtapuska's avatar dtapuska Committed by Commit bot

Scale the deltaX/deltaY on the mouse wheel events to be consistent with the...

Scale the deltaX/deltaY on the mouse wheel events to be consistent with the compositor implementation.

As the page is zoomed in the scroll amount shouldn't increase. This issue
was discovered with the conversion to mouse wheel gestures which uses
gesture scrolls which are scaled; and the layout test was failing for those
cases.

BUG=595441

Review URL: https://codereview.chromium.org/1812653002

Cr-Commit-Position: refs/heads/master@{#381702}
parent 5e2a7d4d
......@@ -6,7 +6,7 @@ window.jsTestIsAsync = true;
function testVerticalScroll() {
// Do a purely vertical scroll. This will scroll contents only.
eventSender.continuousMouseScrollBy(0, -1);
eventSender.continuousMouseScrollBy(0, -2);
shouldBecomeEqual('internals.visualViewportScrollX() == 200 && ' +
'internals.visualViewportScrollY() == 301', 'true', testHorizontalScroll);
}
......@@ -14,7 +14,7 @@ function testVerticalScroll() {
function testHorizontalScroll() {
// Do a purely horizontal scroll. This will change pinch virtual viewport
// offset only.
eventSender.continuousMouseScrollBy(-1, 0);
eventSender.continuousMouseScrollBy(-2, 0);
shouldBecomeEqual('internals.visualViewportScrollX() == 201 && ' +
'internals.visualViewportScrollY() == 301', 'true', testDiagonalScroll);
}
......@@ -23,7 +23,7 @@ function testDiagonalScroll() {
// Do a diagonal scroll. This will scroll the contents, and then bubble the
// result up to the visual viewport, where it will change the pinch
// virtual viewport offset.
eventSender.continuousMouseScrollBy(2, 2);
eventSender.continuousMouseScrollBy(4, 4);
shouldBecomeEqual('internals.visualViewportScrollX() == 199 && ' +
'internals.visualViewportScrollY() == 299', 'true', finishJSTest);
}
......
......@@ -34,7 +34,7 @@
if (window.eventSender) {
eventSender.mouseMoveTo(100, 100);
eventSender.mouseScrollBy(0, -5);
eventSender.mouseScrollBy(0, -10);
}
shouldBecomeEqual("internals.visualViewportScrollY()", "200", finishJSTest);
......
......@@ -153,8 +153,8 @@ PlatformWheelEventBuilder::PlatformWheelEventBuilder(Widget* widget, const WebMo
{
m_position = widget->convertFromRootFrame(flooredIntPoint(convertHitPointToRootFrame(widget, FloatPoint(e.x, e.y))));
m_globalPosition = IntPoint(e.globalX, e.globalY);
m_deltaX = e.deltaX;
m_deltaY = e.deltaY;
m_deltaX = scaleDeltaToWindow(widget, e.deltaX);
m_deltaY = scaleDeltaToWindow(widget, e.deltaY);
m_wheelTicksX = e.wheelTicksX;
m_wheelTicksY = e.wheelTicksY;
m_granularity = e.scrollByPage ?
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment