summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authordtapuska <dtapuska@chromium.org>2016-03-17 06:59:23 -0700
committerCommit bot <commit-bot@chromium.org>2016-03-17 14:00:48 +0000
commitaa27c866cdef570e9788f9a93a3a3d87aa36ebce (patch)
tree60991495911b91e25603e6ea1b1c77e071608be5
parent5e2a7d4d2ade23509e4e00464736556db8eff59d (diff)
downloadchromium_src-aa27c866cdef570e9788f9a93a3a3d87aa36ebce.zip
chromium_src-aa27c866cdef570e9788f9a93a3a3d87aa36ebce.tar.gz
chromium_src-aa27c866cdef570e9788f9a93a3a3d87aa36ebce.tar.bz2
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}
-rw-r--r--third_party/WebKit/LayoutTests/fast/events/gesture-pinch-zoom-scroll-bubble.html6
-rw-r--r--third_party/WebKit/LayoutTests/fast/events/scroll-in-scaled-page-with-overflow-hidden.html2
-rw-r--r--third_party/WebKit/Source/web/WebInputEventConversion.cpp4
3 files changed, 6 insertions, 6 deletions
diff --git a/third_party/WebKit/LayoutTests/fast/events/gesture-pinch-zoom-scroll-bubble.html b/third_party/WebKit/LayoutTests/fast/events/gesture-pinch-zoom-scroll-bubble.html
index 2cb634a..d005541 100644
--- a/third_party/WebKit/LayoutTests/fast/events/gesture-pinch-zoom-scroll-bubble.html
+++ b/third_party/WebKit/LayoutTests/fast/events/gesture-pinch-zoom-scroll-bubble.html
@@ -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);
}
diff --git a/third_party/WebKit/LayoutTests/fast/events/scroll-in-scaled-page-with-overflow-hidden.html b/third_party/WebKit/LayoutTests/fast/events/scroll-in-scaled-page-with-overflow-hidden.html
index f10c86a..470a76b 100644
--- a/third_party/WebKit/LayoutTests/fast/events/scroll-in-scaled-page-with-overflow-hidden.html
+++ b/third_party/WebKit/LayoutTests/fast/events/scroll-in-scaled-page-with-overflow-hidden.html
@@ -34,7 +34,7 @@
if (window.eventSender) {
eventSender.mouseMoveTo(100, 100);
- eventSender.mouseScrollBy(0, -5);
+ eventSender.mouseScrollBy(0, -10);
}
shouldBecomeEqual("internals.visualViewportScrollY()", "200", finishJSTest);
diff --git a/third_party/WebKit/Source/web/WebInputEventConversion.cpp b/third_party/WebKit/Source/web/WebInputEventConversion.cpp
index 1ae6a4a..946fd9d 100644
--- a/third_party/WebKit/Source/web/WebInputEventConversion.cpp
+++ b/third_party/WebKit/Source/web/WebInputEventConversion.cpp
@@ -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 ?