[chromium] Scroll deltas should be floats
authoraelias@chromium.org <aelias@chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 6 Mar 2013 01:29:55 +0000 (01:29 +0000)
committeraelias@chromium.org <aelias@chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 6 Mar 2013 01:29:55 +0000 (01:29 +0000)
https://bugs.webkit.org/show_bug.cgi?id=111465

Reviewed by James Robinson.

This converts the remaining scroll delta fields to floats so that
we no longer lose precision due to DIP conversion. The natural
type for deltas is WebFloatSize, which was missing, so I also created
that type based on the existing WebSize header.

Source/Platform:

* Platform.gypi:
* chromium/public/WebFloatSize.h: Added.
(WebKit):
(WebFloatSize):
(WebKit::WebFloatSize::isEmpty):
(WebKit::WebFloatSize::WebFloatSize):
(WebKit::WebFloatSize::operator=):
(WebKit::WebFloatSize::operator WebCore::FloatSize):
(WebKit::WebFloatSize::operator gfx::SizeF):
(WebKit::WebFloatSize::operator gfx::Vector2dF):
(WebKit::operator==):
(WebKit::operator!=):
* chromium/public/WebGestureCurveTarget.h:
(WebKit::WebGestureCurveTarget::scrollBy):
(WebGestureCurveTarget):
* chromium/public/WebInputHandlerClient.h:
(WebKit::WebInputHandlerClient::scrollByIfPossible):
(WebInputHandlerClient):

Source/WebKit/chromium:

* src/WebCompositorInputHandlerImpl.cpp:
(WebKit::WebCompositorInputHandlerImpl::handleInputEventInternal):
(WebKit::WebCompositorInputHandlerImpl::touchpadFlingScroll):
(WebKit::WebCompositorInputHandlerImpl::scrollBy):
* src/WebCompositorInputHandlerImpl.h:
(WebCompositorInputHandlerImpl):
* src/WebViewImpl.cpp:
(WebKit::WebViewImpl::scrollBy):
* src/WebViewImpl.h:
(WebViewImpl):
* tests/WebCompositorInputHandlerImplTest.cpp:
(MockWebInputHandlerClient):
(WebKit::TEST_F):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@144856 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Source/Platform/ChangeLog
Source/Platform/Platform.gypi
Source/Platform/chromium/public/WebFloatSize.h [new file with mode: 0644]
Source/Platform/chromium/public/WebGestureCurveTarget.h
Source/Platform/chromium/public/WebInputHandlerClient.h
Source/WebKit/chromium/ChangeLog
Source/WebKit/chromium/src/WebCompositorInputHandlerImpl.cpp
Source/WebKit/chromium/src/WebCompositorInputHandlerImpl.h
Source/WebKit/chromium/src/WebViewImpl.cpp
Source/WebKit/chromium/src/WebViewImpl.h
Source/WebKit/chromium/tests/WebCompositorInputHandlerImplTest.cpp

index 6d3ccdf..73ad9ee 100644 (file)
@@ -1,3 +1,34 @@
+2013-03-05  Alexandre Elias  <aelias@chromium.org>
+
+        [chromium] Scroll deltas should be floats
+        https://bugs.webkit.org/show_bug.cgi?id=111465
+
+        Reviewed by James Robinson.
+
+        This converts the remaining scroll delta fields to floats so that
+        we no longer lose precision due to DIP conversion. The natural
+        type for deltas is WebFloatSize, which was missing, so I also created
+        that type based on the existing WebSize header.
+
+        * Platform.gypi:
+        * chromium/public/WebFloatSize.h: Added.
+        (WebKit):
+        (WebFloatSize):
+        (WebKit::WebFloatSize::isEmpty):
+        (WebKit::WebFloatSize::WebFloatSize):
+        (WebKit::WebFloatSize::operator=):
+        (WebKit::WebFloatSize::operator WebCore::FloatSize):
+        (WebKit::WebFloatSize::operator gfx::SizeF):
+        (WebKit::WebFloatSize::operator gfx::Vector2dF):
+        (WebKit::operator==):
+        (WebKit::operator!=):
+        * chromium/public/WebGestureCurveTarget.h:
+        (WebKit::WebGestureCurveTarget::scrollBy):
+        (WebGestureCurveTarget):
+        * chromium/public/WebInputHandlerClient.h:
+        (WebKit::WebInputHandlerClient::scrollByIfPossible):
+        (WebInputHandlerClient):
+
 2013-03-04  James Robinson  <jamesr@chromium.org>
 
         [chromium] Move check for threaded compositing from WebCompositorSupport to Platform
index 334449b..8ff1127 100644 (file)
@@ -65,6 +65,7 @@
             'chromium/public/WebFloatKeyframe.h',
             'chromium/public/WebFloatPoint.h',
             'chromium/public/WebFloatQuad.h',
+            'chromium/public/WebFloatSize.h',
             'chromium/public/WebFloatRect.h',
             'chromium/public/WebGamepad.h',
             'chromium/public/WebGamepads.h',
diff --git a/Source/Platform/chromium/public/WebFloatSize.h b/Source/Platform/chromium/public/WebFloatSize.h
new file mode 100644 (file)
index 0000000..5de9495
--- /dev/null
@@ -0,0 +1,133 @@
+/*
+ * Copyright (C) 2013 Google Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ *
+ *     * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *     * Redistributions in binary form must reproduce the above
+ * copyright notice, this list of conditions and the following disclaimer
+ * in the documentation and/or other materials provided with the
+ * distribution.
+ *     * Neither the name of Google Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef WebFloatSize_h
+#define WebFloatSize_h
+
+#include "WebCommon.h"
+
+#if WEBKIT_IMPLEMENTATION
+#include "FloatSize.h"
+#else
+#include <cmath>
+#include <ui/gfx/size_f.h>
+#include <ui/gfx/vector2d_f.h>
+#endif
+
+namespace WebKit {
+
+struct WebFloatSize {
+    float width;
+    float height;
+
+    bool isEmpty() const { return width <= 0 || height <= 0; }
+
+    WebFloatSize()
+        : width(0)
+        , height(0)
+    {
+    }
+
+    WebFloatSize(float width, float height)
+        : width(width)
+        , height(height)
+    {
+    }
+
+#if WEBKIT_IMPLEMENTATION
+    WebFloatSize(const WebCore::FloatSize& s)
+        : width(s.width())
+        , height(s.height())
+    {
+    }
+
+    WebFloatSize& operator=(const WebCore::FloatSize& s)
+    {
+        width = s.width();
+        height = s.height();
+        return *this;
+    }
+
+    operator WebCore::FloatSize() const
+    {
+        return WebCore::FloatSize(width, height);
+    }
+#else
+    WebFloatSize(const gfx::SizeF& s)
+        : width(s.width())
+        , height(s.height())
+    {
+    }
+
+    WebFloatSize(const gfx::Vector2dF& v)
+        : width(v.x())
+        , height(v.y())
+    {
+    }
+
+    WebFloatSize& operator=(const gfx::SizeF& s)
+    {
+        width = s.width();
+        height = s.height();
+        return *this;
+    }
+
+    WebFloatSize& operator=(const gfx::Vector2dF& v)
+    {
+        width = v.x();
+        height = v.y();
+        return *this;
+    }
+
+    operator gfx::SizeF() const
+    {
+        return gfx::SizeF(std::max(0.f, width), std::max(0.f, height));
+    }
+
+    operator gfx::Vector2dF() const
+    {
+        return gfx::Vector2dF(width, height);
+    }
+#endif
+};
+
+inline bool operator==(const WebFloatSize& a, const WebFloatSize& b)
+{
+    return a.width == b.width && a.height == b.height;
+}
+
+inline bool operator!=(const WebFloatSize& a, const WebFloatSize& b)
+{
+    return !(a == b);
+}
+
+} // namespace WebKit
+
+#endif
index a44bfbf..cfc2a82 100644 (file)
 #ifndef WebGestureCurveTarget_h
 #define WebGestureCurveTarget_h
 
-namespace WebKit {
+#include "WebFloatSize.h"
+#include "WebPoint.h"
 
-struct WebPoint;
+namespace WebKit {
 
 class WebGestureCurveTarget {
 public:
-    virtual void scrollBy(const WebPoint&) = 0;
+    virtual void scrollBy(const WebFloatSize& delta) { scrollBy(WebPoint(delta.width, delta.height)); }
+
+    // TODO(aelias): Delete this after WebKit roll.
+    virtual void scrollBy(const WebPoint& delta) { scrollBy(WebFloatSize(delta.x, delta.y)); }
 
 protected:
     virtual ~WebGestureCurveTarget() { }
index baecfbd..026ba0a 100644 (file)
@@ -25,6 +25,7 @@
 #define WebInputHandlerClient_h
 
 #include "WebCommon.h"
+#include "WebFloatSize.h"
 #include "WebPoint.h"
 #include "WebSize.h"
 
@@ -55,7 +56,10 @@ public:
     // ancestor layer that can be scrolled will be moved instead. If there is no
     // such layer to be moved, this returns false. Returns true otherwise.
     // Should only be called if scrollBegin() returned ScrollStarted.
-    virtual bool scrollByIfPossible(WebPoint, WebSize) = 0;
+    virtual bool scrollByIfPossible(WebPoint origin, WebFloatSize delta) { return scrollByIfPossible(origin, WebSize(delta.width, delta.height)); }
+
+    // TODO(aelias): Delete this after WebKit roll.
+    virtual bool scrollByIfPossible(WebPoint origin, WebSize delta) { return scrollByIfPossible(origin, WebFloatSize(delta.width, delta.height)); }
 
     // Stop scrolling the selected layer. Should only be called if scrollBegin()
     // returned ScrollStarted.
index d2b5c1f..d88e043 100644 (file)
@@ -1,3 +1,29 @@
+2013-03-05  Alexandre Elias  <aelias@chromium.org>
+
+        [chromium] Scroll deltas should be floats
+        https://bugs.webkit.org/show_bug.cgi?id=111465
+
+        Reviewed by James Robinson.
+
+        This converts the remaining scroll delta fields to floats so that
+        we no longer lose precision due to DIP conversion. The natural
+        type for deltas is WebFloatSize, which was missing, so I also created
+        that type based on the existing WebSize header.
+
+        * src/WebCompositorInputHandlerImpl.cpp:
+        (WebKit::WebCompositorInputHandlerImpl::handleInputEventInternal):
+        (WebKit::WebCompositorInputHandlerImpl::touchpadFlingScroll):
+        (WebKit::WebCompositorInputHandlerImpl::scrollBy):
+        * src/WebCompositorInputHandlerImpl.h:
+        (WebCompositorInputHandlerImpl):
+        * src/WebViewImpl.cpp:
+        (WebKit::WebViewImpl::scrollBy):
+        * src/WebViewImpl.h:
+        (WebViewImpl):
+        * tests/WebCompositorInputHandlerImplTest.cpp:
+        (MockWebInputHandlerClient):
+        (WebKit::TEST_F):
+
 2013-03-05  Alec Flett  <alecflett@chromium.org>
 
         IndexedDB: Add IDBBackingStoreTest
index 9af8979..d627720 100644 (file)
@@ -123,7 +123,7 @@ WebCompositorInputHandlerImpl::EventDisposition WebCompositorInputHandlerImpl::h
         switch (scrollStatus) {
         case WebInputHandlerClient::ScrollStatusStarted: {
             TRACE_EVENT_INSTANT2("webkit", "WebCompositorInputHandlerImpl::handleInput wheel scroll", "deltaX", -wheelEvent.deltaX, "deltaY", -wheelEvent.deltaY);
-            bool didScroll = m_inputHandlerClient->scrollByIfPossible(WebPoint(wheelEvent.x, wheelEvent.y), IntSize(-wheelEvent.deltaX, -wheelEvent.deltaY));
+            bool didScroll = m_inputHandlerClient->scrollByIfPossible(WebPoint(wheelEvent.x, wheelEvent.y), WebFloatSize(-wheelEvent.deltaX, -wheelEvent.deltaY));
             m_inputHandlerClient->scrollEnd();
             return didScroll ? DidHandle : DropEvent;
         }
@@ -159,7 +159,7 @@ WebCompositorInputHandlerImpl::EventDisposition WebCompositorInputHandlerImpl::h
 
         const WebGestureEvent& gestureEvent = *static_cast<const WebGestureEvent*>(&event);
         bool didScroll = m_inputHandlerClient->scrollByIfPossible(WebPoint(gestureEvent.x, gestureEvent.y),
-            IntSize(-gestureEvent.data.scrollUpdate.deltaX, -gestureEvent.data.scrollUpdate.deltaY));
+            WebFloatSize(-gestureEvent.data.scrollUpdate.deltaX, -gestureEvent.data.scrollUpdate.deltaY));
         return didScroll ? DidHandle : DropEvent;
     } else if (event.type == WebInputEvent::GestureScrollEnd) {
         ASSERT(m_expectScrollUpdateEnd);
@@ -294,12 +294,12 @@ bool WebCompositorInputHandlerImpl::cancelCurrentFling()
     return hadFlingAnimation;
 }
 
-bool WebCompositorInputHandlerImpl::touchpadFlingScroll(const WebPoint& increment)
+bool WebCompositorInputHandlerImpl::touchpadFlingScroll(const WebFloatSize& increment)
 {
     WebMouseWheelEvent syntheticWheel;
     syntheticWheel.type = WebInputEvent::MouseWheel;
-    syntheticWheel.deltaX = increment.x;
-    syntheticWheel.deltaY = increment.y;
+    syntheticWheel.deltaX = increment.width;
+    syntheticWheel.deltaY = increment.height;
     syntheticWheel.hasPreciseScrollingDeltas = true;
     syntheticWheel.x = m_flingParameters.point.x;
     syntheticWheel.y = m_flingParameters.point.y;
@@ -330,12 +330,12 @@ bool WebCompositorInputHandlerImpl::touchpadFlingScroll(const WebPoint& incremen
     return false;
 }
 
-void WebCompositorInputHandlerImpl::scrollBy(const WebPoint& increment)
+void WebCompositorInputHandlerImpl::scrollBy(const WebFloatSize& increment)
 {
-    if (increment == WebPoint())
+    if (increment == WebFloatSize())
         return;
 
-    TRACE_EVENT2("webkit", "WebCompositorInputHandlerImpl::scrollBy", "x", increment.x, "y", increment.y);
+    TRACE_EVENT2("webkit", "WebCompositorInputHandlerImpl::scrollBy", "x", increment.width, "y", increment.height);
 
     bool didScroll = false;
 
@@ -344,13 +344,13 @@ void WebCompositorInputHandlerImpl::scrollBy(const WebPoint& increment)
         didScroll = touchpadFlingScroll(increment);
         break;
     case WebGestureEvent::Touchscreen:
-        didScroll = m_inputHandlerClient->scrollByIfPossible(m_flingParameters.point, IntSize(-increment.x, -increment.y));
+        didScroll = m_inputHandlerClient->scrollByIfPossible(m_flingParameters.point, WebFloatSize(-increment.width, -increment.height));
         break;
     }
 
     if (didScroll) {
-        m_flingParameters.cumulativeScroll.width += increment.x;
-        m_flingParameters.cumulativeScroll.height += increment.y;
+        m_flingParameters.cumulativeScroll.width += increment.width;
+        m_flingParameters.cumulativeScroll.height += increment.height;
     }
 }
 
index 9dfad60..7292ff5 100644 (file)
@@ -66,7 +66,7 @@ public:
     virtual void mainThreadHasStoppedFlinging();
 
     // WebGestureCurveTarget implementation.
-    virtual void scrollBy(const WebPoint&);
+    virtual void scrollBy(const WebFloatSize&);
 
     int identifier() const { return m_identifier; }
 
@@ -80,7 +80,7 @@ private:
     EventDisposition handleGestureFling(const WebGestureEvent&);
 
     // Returns true if we scrolled by the increment.
-    bool touchpadFlingScroll(const WebPoint& increment);
+    bool touchpadFlingScroll(const WebFloatSize& increment);
 
     // Returns true if we actually had an active fling to cancel.
     bool cancelCurrentFling();
index 770a6b0..edc4ca2 100644 (file)
@@ -658,16 +658,16 @@ bool WebViewImpl::handleMouseWheel(Frame& mainFrame, const WebMouseWheelEvent& e
     return PageWidgetEventHandler::handleMouseWheel(mainFrame, event);
 }
 
-void WebViewImpl::scrollBy(const WebPoint& delta)
+void WebViewImpl::scrollBy(const WebFloatSize& delta)
 {
     if (m_flingSourceDevice == WebGestureEvent::Touchpad) {
         WebMouseWheelEvent syntheticWheel;
         const float tickDivisor = WebCore::WheelEvent::TickMultiplier;
 
-        syntheticWheel.deltaX = delta.x;
-        syntheticWheel.deltaY = delta.y;
-        syntheticWheel.wheelTicksX = delta.x / tickDivisor;
-        syntheticWheel.wheelTicksY = delta.y / tickDivisor;
+        syntheticWheel.deltaX = delta.width;
+        syntheticWheel.deltaY = delta.height;
+        syntheticWheel.wheelTicksX = delta.width / tickDivisor;
+        syntheticWheel.wheelTicksY = delta.height / tickDivisor;
         syntheticWheel.hasPreciseScrollingDeltas = true;
         syntheticWheel.x = m_positionOnFlingStart.x;
         syntheticWheel.y = m_positionOnFlingStart.y;
@@ -681,8 +681,8 @@ void WebViewImpl::scrollBy(const WebPoint& delta)
         WebGestureEvent syntheticGestureEvent;
 
         syntheticGestureEvent.type = WebInputEvent::GestureScrollUpdateWithoutPropagation;
-        syntheticGestureEvent.data.scrollUpdate.deltaX = delta.x;
-        syntheticGestureEvent.data.scrollUpdate.deltaY = delta.y;
+        syntheticGestureEvent.data.scrollUpdate.deltaX = delta.width;
+        syntheticGestureEvent.data.scrollUpdate.deltaY = delta.height;
         syntheticGestureEvent.x = m_positionOnFlingStart.x;
         syntheticGestureEvent.y = m_positionOnFlingStart.y;
         syntheticGestureEvent.globalX = m_globalPositionOnFlingStart.x;
index 64f736f..f455f44 100644 (file)
@@ -400,7 +400,7 @@ public:
     void hasTouchEventHandlers(bool);
 
     // WebGestureCurveTarget implementation for fling.
-    virtual void scrollBy(const WebPoint&);
+    virtual void scrollBy(const WebFloatSize&);
 
     // Handles context menu events orignated via the the keyboard. These
     // include the VK_APPS virtual key and the Shift+F10 combine. Code is
index 5821c91..dac314c 100644 (file)
@@ -33,6 +33,7 @@
 #include <gmock/gmock.h>
 #include <gtest/gtest.h>
 #include <public/WebFloatPoint.h>
+#include <public/WebFloatSize.h>
 #include <public/WebInputHandler.h>
 #include <public/WebInputHandlerClient.h>
 #include <public/WebPoint.h>
@@ -61,7 +62,7 @@ public:
     MOCK_METHOD1(haveTouchEventHandlersAt, bool(WebPoint));
 
     MOCK_METHOD2(scrollBegin, ScrollStatus(WebPoint, WebInputHandlerClient::ScrollInputType));
-    MOCK_METHOD2(scrollByIfPossible, bool(WebPoint, WebSize));
+    MOCK_METHOD2(scrollByIfPossible, bool(WebPoint, WebFloatSize));
     MOCK_METHOD0(scrollEnd, void());
 
     MOCK_METHOD0(didReceiveLastInputEventForVSync, void());
@@ -165,7 +166,7 @@ TEST_F(WebCompositorInputHandlerImplTest, gestureScrollStarted)
 
     gesture.type = WebInputEvent::GestureScrollUpdate;
     gesture.data.scrollUpdate.deltaY = -40; // -Y means scroll down - i.e. in the +Y direction.
-    EXPECT_CALL(m_mockInputHandlerClient, scrollByIfPossible(testing::_, testing::Field(&WebSize::height, testing::Gt(0))))
+    EXPECT_CALL(m_mockInputHandlerClient, scrollByIfPossible(testing::_, testing::Field(&WebFloatSize::height, testing::Gt(0))))
         .WillOnce(testing::Return(false));
     m_inputHandler->handleInputEvent(gesture);
 
@@ -175,7 +176,7 @@ TEST_F(WebCompositorInputHandlerImplTest, gestureScrollStarted)
 
     gesture.type = WebInputEvent::GestureScrollUpdate;
     gesture.data.scrollUpdate.deltaY = -40; // -Y means scroll down - i.e. in the +Y direction.
-    EXPECT_CALL(m_mockInputHandlerClient, scrollByIfPossible(testing::_, testing::Field(&WebSize::height, testing::Gt(0))))
+    EXPECT_CALL(m_mockInputHandlerClient, scrollByIfPossible(testing::_, testing::Field(&WebFloatSize::height, testing::Gt(0))))
         .WillOnce(testing::Return(true));
     m_inputHandler->handleInputEvent(gesture);
 
@@ -303,7 +304,7 @@ TEST_F(WebCompositorInputHandlerImplTest, gesturePinchAfterScrollOnMainThread)
 
     gesture.type = WebInputEvent::GestureScrollUpdate;
     gesture.data.scrollUpdate.deltaY = -40; // -Y means scroll down - i.e. in the +Y direction.
-    EXPECT_CALL(m_mockInputHandlerClient, scrollByIfPossible(testing::_, testing::Field(&WebSize::height, testing::Gt(0))))
+    EXPECT_CALL(m_mockInputHandlerClient, scrollByIfPossible(testing::_, testing::Field(&WebFloatSize::height, testing::Gt(0))))
         .WillOnce(testing::Return(true));
     m_inputHandler->handleInputEvent(gesture);
 
@@ -440,7 +441,7 @@ TEST_F(WebCompositorInputHandlerImplTest, gestureFlingAnimatesTouchpad)
     EXPECT_CALL(m_mockInputHandlerClient, scheduleAnimation());
     EXPECT_CALL(m_mockInputHandlerClient, scrollBegin(testing::_, testing::_))
         .WillOnce(testing::Return(WebInputHandlerClient::ScrollStatusStarted));
-    EXPECT_CALL(m_mockInputHandlerClient, scrollByIfPossible(testing::_, testing::Field(&WebSize::width, testing::Lt(0))))
+    EXPECT_CALL(m_mockInputHandlerClient, scrollByIfPossible(testing::_, testing::Field(&WebFloatSize::width, testing::Lt(0))))
         .WillOnce(testing::Return(true));
     EXPECT_CALL(m_mockInputHandlerClient, scrollEnd());
     m_inputHandler->animate(10.1);
@@ -524,7 +525,7 @@ TEST_F(WebCompositorInputHandlerImplTest, gestureFlingTransferResetsTouchpad)
     EXPECT_CALL(m_mockInputHandlerClient, scheduleAnimation());
     EXPECT_CALL(m_mockInputHandlerClient, scrollBegin(testing::_, testing::_))
         .WillOnce(testing::Return(WebInputHandlerClient::ScrollStatusStarted));
-    EXPECT_CALL(m_mockInputHandlerClient, scrollByIfPossible(testing::_, testing::Field(&WebSize::width, testing::Lt(0))))
+    EXPECT_CALL(m_mockInputHandlerClient, scrollByIfPossible(testing::_, testing::Field(&WebFloatSize::width, testing::Lt(0))))
         .WillOnce(testing::Return(true));
     EXPECT_CALL(m_mockInputHandlerClient, scrollEnd());
     m_inputHandler->animate(10.1);
@@ -607,7 +608,7 @@ TEST_F(WebCompositorInputHandlerImplTest, gestureFlingTransferResetsTouchpad)
     EXPECT_CALL(m_mockInputHandlerClient, scheduleAnimation());
     EXPECT_CALL(m_mockInputHandlerClient, scrollBegin(testing::_, testing::_))
         .WillOnce(testing::Return(WebInputHandlerClient::ScrollStatusStarted));
-    EXPECT_CALL(m_mockInputHandlerClient, scrollByIfPossible(testing::_, testing::Field(&WebSize::height, testing::Gt(0))))
+    EXPECT_CALL(m_mockInputHandlerClient, scrollByIfPossible(testing::_, testing::Field(&WebFloatSize::height, testing::Gt(0))))
         .WillOnce(testing::Return(true));
     EXPECT_CALL(m_mockInputHandlerClient, scrollEnd());
     m_inputHandler->animate(30.1);
@@ -737,7 +738,7 @@ TEST_F(WebCompositorInputHandlerImplTest, gestureFlingAnimatesTouchscreen)
 
     // The second call should start scrolling in the -X direction.
     EXPECT_CALL(m_mockInputHandlerClient, scheduleAnimation());
-    EXPECT_CALL(m_mockInputHandlerClient, scrollByIfPossible(testing::_, testing::Field(&WebSize::width, testing::Lt(0))))
+    EXPECT_CALL(m_mockInputHandlerClient, scrollByIfPossible(testing::_, testing::Field(&WebFloatSize::width, testing::Lt(0))))
         .WillOnce(testing::Return(true));
     m_inputHandler->animate(10.1);