[SCM] WebKit Debian packaging branch, debian/experimental, updated. upstream/1.3.3-9427-gc2be6fc

aroben at apple.com aroben at apple.com
Wed Dec 22 15:16:26 UTC 2010


The following commit has been merged in the debian/experimental branch:
commit b5ab54fce3f0f9e14063e502f16cc686ef98e2b1
Author: aroben at apple.com <aroben at apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Fri Oct 29 17:06:16 2010 +0000

    Use IntPoint/FloatSize in WebEvent subclasses
    
    This is nicer than passing around pairs of ints/floats.
    
    Fixes <http://webkit.org/b/48611>.
    
    Reviewed by Anders Carlsson.
    
    * Shared/WebEvent.h:
    * Shared/WebMouseEvent.cpp:
    * Shared/WebPlatformTouchPoint.cpp:
    * Shared/WebWheelEvent.cpp:
    Changed all x/y pairs to either use IntPoint or FloatSize, as
    appropriate.
    
    * Shared/WebEventConversion.cpp:
    * Shared/mac/WebEventFactory.mm:
    * Shared/qt/WebEventFactoryQt.cpp:
    * Shared/win/WebEventFactory.cpp:
    * WebProcess/Plugins/Netscape/mac/NetscapePluginMac.mm:
    * WebProcess/Plugins/Netscape/win/NetscapePluginWin.cpp:
    Updated for WebEvent changes.
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@70892 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/WebKit2/ChangeLog b/WebKit2/ChangeLog
index b39ab5f..7790e9c 100644
--- a/WebKit2/ChangeLog
+++ b/WebKit2/ChangeLog
@@ -1,3 +1,28 @@
+2010-10-28  Adam Roben  <aroben at apple.com>
+
+        Use IntPoint/FloatSize in WebEvent subclasses
+
+        This is nicer than passing around pairs of ints/floats.
+
+        Fixes <http://webkit.org/b/48611>.
+
+        Reviewed by Anders Carlsson.
+
+        * Shared/WebEvent.h:
+        * Shared/WebMouseEvent.cpp:
+        * Shared/WebPlatformTouchPoint.cpp:
+        * Shared/WebWheelEvent.cpp:
+        Changed all x/y pairs to either use IntPoint or FloatSize, as
+        appropriate.
+
+        * Shared/WebEventConversion.cpp:
+        * Shared/mac/WebEventFactory.mm:
+        * Shared/qt/WebEventFactoryQt.cpp:
+        * Shared/win/WebEventFactory.cpp:
+        * WebProcess/Plugins/Netscape/mac/NetscapePluginMac.mm:
+        * WebProcess/Plugins/Netscape/win/NetscapePluginWin.cpp:
+        Updated for WebEvent changes.
+
 2010-10-29  Adam Roben  <aroben at apple.com>
 
         Touch WebKit2Prefix.h to fix incremental builds on Windows
diff --git a/WebKit2/Shared/WebEvent.h b/WebKit2/Shared/WebEvent.h
index 67120da..46c3687 100644
--- a/WebKit2/Shared/WebEvent.h
+++ b/WebKit2/Shared/WebEvent.h
@@ -29,6 +29,8 @@
 // FIXME: We should probably move to makeing the WebCore/PlatformFooEvents trivial classes so that
 // we can use them as the event type.
 
+#include <WebCore/FloatSize.h>
+#include <WebCore/IntPoint.h>
 #include <wtf/text/WTFString.h>
 
 namespace CoreIPC {
@@ -105,13 +107,11 @@ public:
 
     WebMouseEvent() { }
 
-    WebMouseEvent(Type, Button, int x, int y, int globalX, int globalY, float deltaX, float deltaY, float deltaZ, int clickCount, Modifiers, double timestamp);
+    WebMouseEvent(Type, Button, const WebCore::IntPoint& position, const WebCore::IntPoint& globalPosition, float deltaX, float deltaY, float deltaZ, int clickCount, Modifiers, double timestamp);
 
     Button button() const { return m_button; }
-    int positionX() const { return m_positionX; }
-    int positionY() const { return m_positionY; }
-    int globalPositionX() const { return m_globalPositionX; }
-    int globalPositionY() const { return m_globalPositionY; }
+    const WebCore::IntPoint& position() const { return m_position; }
+    const WebCore::IntPoint& globalPosition() const { return m_globalPosition; }
     float deltaX() const { return m_deltaX; }
     float deltaY() const { return m_deltaY; }
     float deltaZ() const { return m_deltaZ; }
@@ -124,10 +124,8 @@ private:
     static bool isMouseEventType(Type);
 
     Button m_button;
-    int m_positionX;
-    int m_positionY;
-    int m_globalPositionX;
-    int m_globalPositionY;
+    WebCore::IntPoint m_position;
+    WebCore::IntPoint m_globalPosition;
     float m_deltaX;
     float m_deltaY;
     float m_deltaZ;
@@ -144,16 +142,12 @@ public:
 
     WebWheelEvent() { }
 
-    WebWheelEvent(Type, int x, int y, int globalX, int globalY, float deltaX, float deltaY, float wheelTicksX, float wheelTicksY, Granularity, Modifiers, double timestamp);
+    WebWheelEvent(Type, const WebCore::IntPoint& position, const WebCore::IntPoint& globalPosition, const WebCore::FloatSize& delta, const WebCore::FloatSize& wheelTicks, Granularity, Modifiers, double timestamp);
 
-    int positionX() const { return m_positionX; }
-    int positionY() const { return m_positionY; }
-    int globalPositionX() const { return m_globalPositionX; }
-    int globalPositionY() const { return m_globalPositionY; }
-    float deltaX() const { return m_deltaX; }
-    float deltaY() const { return m_deltaY; }
-    float wheelTicksX() const { return m_wheelTicksX; }
-    float wheelTicksY() const { return m_wheelTicksY; }
+    const WebCore::IntPoint position() const { return m_position; }
+    const WebCore::IntPoint globalPosition() const { return m_globalPosition; }
+    const WebCore::FloatSize delta() const { return m_delta; }
+    const WebCore::FloatSize wheelTicks() const { return m_wheelTicks; }
     Granularity granularity() const { return (Granularity)m_granularity; }
 
     void encode(CoreIPC::ArgumentEncoder*) const;
@@ -162,14 +156,10 @@ public:
 private:
     static bool isWheelEventType(Type);
 
-    int m_positionX;
-    int m_positionY;
-    int m_globalPositionX;
-    int m_globalPositionY;
-    float m_deltaX;
-    float m_deltaY;
-    float m_wheelTicksX;
-    float m_wheelTicksY;
+    WebCore::IntPoint m_position;
+    WebCore::IntPoint m_globalPosition;
+    WebCore::FloatSize m_delta;
+    WebCore::FloatSize m_wheelTicks;
     unsigned m_granularity; // Granularity
 };
 
@@ -222,15 +212,13 @@ public:
 
     WebPlatformTouchPoint() { }
 
-    WebPlatformTouchPoint(unsigned id, TouchPointState, int screenPosX, int screenPosY, int posX, int posY);
+    WebPlatformTouchPoint(unsigned id, TouchPointState, const WebCore::IntPoint& screenPosition, const WebCore::IntPoint& position);
 
     unsigned id() const { return m_id; }
     TouchPointState state() const { return m_state; }
 
-    int screenPosX() const { return m_screenPosX; }
-    int screenPosY() const { return m_screenPosY; }
-    int32_t posX() const { return m_posX; }
-    int32_t posY() const { return m_posY; }
+    const WebCore::IntPoint& screenPosition() const { return m_screenPosition; }
+    const WebCore::IntPoint& position() const { return m_position; }
           
     void setState(TouchPointState state) { m_state = state; }
 
@@ -240,8 +228,8 @@ public:
 private:
     unsigned m_id;
     TouchPointState m_state;
-    int m_screenPosX, m_screenPosY;
-    int32_t m_posX, m_posY;
+    WebCore::IntPoint m_screenPosition;
+    WebCore::IntPoint m_position;
 
 };
 
diff --git a/WebKit2/Shared/WebEventConversion.cpp b/WebKit2/Shared/WebEventConversion.cpp
index ae77e28..04aa6e4 100644
--- a/WebKit2/Shared/WebEventConversion.cpp
+++ b/WebKit2/Shared/WebEventConversion.cpp
@@ -65,8 +65,8 @@ public:
             ASSERT_NOT_REACHED();
         }
 
-        m_position = WebCore::IntPoint(webEvent.positionX(), webEvent.positionY());
-        m_globalPosition = WebCore::IntPoint(webEvent.globalPositionX(), webEvent.globalPositionY());
+        m_position = webEvent.position();
+        m_globalPosition = webEvent.globalPosition();
         m_clickCount = webEvent.clickCount();
         m_timestamp = webEvent.timestamp();
         m_shiftKey = webEvent.shiftKey();
@@ -95,12 +95,12 @@ class WebKit2PlatformWheelEvent : public WebCore::PlatformWheelEvent {
 public:
     WebKit2PlatformWheelEvent(const WebWheelEvent& webEvent)
     {
-        m_position = WebCore::IntPoint(webEvent.positionX(), webEvent.positionY());
-        m_globalPosition = WebCore::IntPoint(webEvent.globalPositionX(), webEvent.globalPositionY());
-        m_deltaX = webEvent.deltaX();
-        m_deltaY = webEvent.deltaY();
-        m_wheelTicksX = webEvent.wheelTicksX();
-        m_wheelTicksY = webEvent.wheelTicksY();
+        m_position = webEvent.position();
+        m_globalPosition = webEvent.globalPosition();
+        m_deltaX = webEvent.delta().width();
+        m_deltaY = webEvent.delta().height();
+        m_wheelTicksX = webEvent.wheelTicks().width();
+        m_wheelTicksY = webEvent.wheelTicks().height();
         m_granularity = (webEvent.granularity() == WebWheelEvent::ScrollByPageWheelEvent) ? WebCore::ScrollByPageWheelEvent : WebCore::ScrollByPixelWheelEvent;
         m_shiftKey = webEvent.shiftKey();
         m_ctrlKey = webEvent.controlKey();
@@ -183,11 +183,8 @@ public:
             ASSERT_NOT_REACHED();
         }
 
-        WebCore::IntPoint screen(webTouchPoint.screenPosX(), webTouchPoint.screenPosY());
-        WebCore::IntPoint position(webTouchPoint.posX(), webTouchPoint.posY());
-
-        m_screenPos = screen;
-        m_pos = position;
+        m_screenPos = webTouchPoint.screenPosition();
+        m_pos = webTouchPoint.position();
     }
 };
 
diff --git a/WebKit2/Shared/WebMouseEvent.cpp b/WebKit2/Shared/WebMouseEvent.cpp
index 97b9d13..faef18d 100644
--- a/WebKit2/Shared/WebMouseEvent.cpp
+++ b/WebKit2/Shared/WebMouseEvent.cpp
@@ -28,15 +28,15 @@
 #include "ArgumentDecoder.h"
 #include "ArgumentEncoder.h"
 
+using namespace WebCore;
+
 namespace WebKit {
 
-WebMouseEvent::WebMouseEvent(Type type, Button button, int x, int y, int globalX, int globalY, float deltaX, float deltaY, float deltaZ, int clickCount, Modifiers modifiers, double timestamp)
+WebMouseEvent::WebMouseEvent(Type type, Button button, const IntPoint& position, const IntPoint& globalPosition, float deltaX, float deltaY, float deltaZ, int clickCount, Modifiers modifiers, double timestamp)
     : WebEvent(type, modifiers, timestamp)
     , m_button(button)
-    , m_positionX(x)
-    , m_positionY(y)
-    , m_globalPositionX(globalX)
-    , m_globalPositionY(globalY)
+    , m_position(position)
+    , m_globalPosition(globalPosition)
     , m_deltaX(deltaX)
     , m_deltaY(deltaY)
     , m_deltaZ(deltaZ)
diff --git a/WebKit2/Shared/WebPlatformTouchPoint.cpp b/WebKit2/Shared/WebPlatformTouchPoint.cpp
index 85eaca4..b34f963 100644
--- a/WebKit2/Shared/WebPlatformTouchPoint.cpp
+++ b/WebKit2/Shared/WebPlatformTouchPoint.cpp
@@ -30,15 +30,15 @@
 #include "ArgumentDecoder.h"
 #include "ArgumentEncoder.h"
 
+using namespace WebCore;
+
 namespace WebKit {
 
-WebPlatformTouchPoint::WebPlatformTouchPoint(unsigned id, TouchPointState state, int screenPosX, int screenPosY, int posX, int posY)
+WebPlatformTouchPoint::WebPlatformTouchPoint(unsigned id, TouchPointState state, const IntPoint& screenPosition, const IntPoint& position)
     : m_id(id)
     , m_state(state)
-    , m_screenPosX(screenPosX)
-    , m_screenPosY(screenPosY)
-    , m_posX(posX)
-    , m_posY(posY)
+    , m_screenPosition(screenPosition)
+    , m_position(position)
 {
 }
 
diff --git a/WebKit2/Shared/WebWheelEvent.cpp b/WebKit2/Shared/WebWheelEvent.cpp
index bb9b2ad..93231f7 100644
--- a/WebKit2/Shared/WebWheelEvent.cpp
+++ b/WebKit2/Shared/WebWheelEvent.cpp
@@ -28,18 +28,16 @@
 #include "ArgumentDecoder.h"
 #include "ArgumentEncoder.h"
 
+using namespace WebCore;
+
 namespace WebKit {    
 
-WebWheelEvent::WebWheelEvent(Type type, int x, int y, int globalX, int globalY, float deltaX, float deltaY, float wheelTicksX, float wheelTicksY, Granularity granularity, Modifiers modifiers, double timestamp)
+WebWheelEvent::WebWheelEvent(Type type, const IntPoint& position, const IntPoint& globalPosition, const FloatSize& delta, const FloatSize& wheelTicks, Granularity granularity, Modifiers modifiers, double timestamp)
     : WebEvent(type, modifiers, timestamp)
-    , m_positionX(x)
-    , m_positionY(y)
-    , m_globalPositionX(globalX)
-    , m_globalPositionY(globalY)
-    , m_deltaX(deltaX)
-    , m_deltaY(deltaY)
-    , m_wheelTicksX(wheelTicksX)
-    , m_wheelTicksY(wheelTicksY)
+    , m_position(position)
+    , m_globalPosition(globalPosition)
+    , m_delta(delta)
+    , m_wheelTicks(wheelTicks)
     , m_granularity(granularity)
 {
     ASSERT(isWheelEventType(type));
diff --git a/WebKit2/Shared/mac/WebEventFactory.mm b/WebKit2/Shared/mac/WebEventFactory.mm
index 4b0443a..a6b321e 100644
--- a/WebKit2/Shared/mac/WebEventFactory.mm
+++ b/WebKit2/Shared/mac/WebEventFactory.mm
@@ -956,10 +956,6 @@ WebMouseEvent WebEventFactory::createWebMouseEvent(NSEvent *event, NSView *windo
 
     WebEvent::Type type                     = mouseEventTypeForEvent(event);
     WebMouseEvent::Button button            = mouseButtonForEvent(event);
-    int positionX                           = position.x;
-    int positionY                           = position.y;
-    int globalPositionX                     = globalPosition.x;
-    int globalPositionY                     = globalPosition.y;
     float deltaX                            = [event deltaX];
     float deltaY                            = [event deltaY];
     float deltaZ                            = [event deltaZ];
@@ -967,7 +963,7 @@ WebMouseEvent WebEventFactory::createWebMouseEvent(NSEvent *event, NSView *windo
     WebEvent::Modifiers modifiers           = modifiersForEvent(event);
     double timestamp                        = [event timestamp];
 
-    return WebMouseEvent(type, button, positionX, positionY, globalPositionX, globalPositionY, deltaX, deltaY, deltaZ, clickCount, modifiers, timestamp);
+    return WebMouseEvent(type, button, IntPoint(position), IntPoint(globalPosition), deltaX, deltaY, deltaZ, clickCount, modifiers, timestamp);
 }
 
 WebWheelEvent WebEventFactory::createWebWheelEvent(NSEvent *event, NSView *windowView)
@@ -975,10 +971,6 @@ WebWheelEvent WebEventFactory::createWebWheelEvent(NSEvent *event, NSView *windo
     NSPoint position = pointForEvent(event, windowView);
     NSPoint globalPosition = globalPointForEvent(event);
 
-    int positionX                           = position.x;
-    int positionY                           = position.y;
-    int globalPositionX                     = globalPosition.x;
-    int globalPositionY                     = globalPosition.y;
     WebWheelEvent::Granularity granularity  = WebWheelEvent::ScrollByPixelWheelEvent;
 
     BOOL continuous;
@@ -1004,7 +996,7 @@ WebWheelEvent WebEventFactory::createWebWheelEvent(NSEvent *event, NSView *windo
     WebEvent::Modifiers modifiers           = modifiersForEvent(event);
     double timestamp                        = [event timestamp];
 
-    return WebWheelEvent(WebEvent::Wheel, positionX, positionY, globalPositionX, globalPositionY, deltaX, deltaY, wheelTicksX, wheelTicksY, granularity, modifiers, timestamp);
+    return WebWheelEvent(WebEvent::Wheel, IntPoint(position), IntPoint(globalPosition), FloatSize(deltaX, deltaY), FloatSize(wheelTicksX, wheelTicksY), granularity, modifiers, timestamp);
 }
 
 WebKeyboardEvent WebEventFactory::createWebKeyboardEvent(NSEvent *event, NSView *)
diff --git a/WebKit2/Shared/qt/WebEventFactoryQt.cpp b/WebKit2/Shared/qt/WebEventFactoryQt.cpp
index aaeb33b..f17d4e7 100644
--- a/WebKit2/Shared/qt/WebEventFactoryQt.cpp
+++ b/WebKit2/Shared/qt/WebEventFactoryQt.cpp
@@ -95,31 +95,21 @@ static inline WebEvent::Modifiers modifiersForEvent(Qt::KeyboardModifiers modifi
 
 WebMouseEvent WebEventFactory::createWebMouseEvent(QGraphicsSceneMouseEvent* event, int eventClickCount)
 {
-    IntPoint position(event->pos().toPoint());
-    IntPoint globalPosition(event->screenPos());
     FloatPoint delta(event->pos().x() - event->lastPos().x(), event->pos().y() - event->lastPos().y());
 
     WebEvent::Type type             = webEventTypeForEvent(event);
     WebMouseEvent::Button button    = mouseButtonForEvent(event);
-    int positionX                   = position.x();
-    int positionY                   = position.y();
-    int globalPositionX             = globalPosition.x();
-    int globalPositionY             = globalPosition.y();
     float deltaX                    = delta.x();
     float deltaY                    = delta.y();
     int clickCount                  = eventClickCount;
     WebEvent::Modifiers modifiers   = modifiersForEvent(event->modifiers());
     double timestamp                = WTF::currentTime();
 
-    return WebMouseEvent(type, button, positionX, positionY, globalPositionX, globalPositionY, deltaX, deltaY, 0.0f, clickCount, modifiers, timestamp);
+    return WebMouseEvent(type, button, event->pos().toPoint(), event->screenPos(), deltaX, deltaY, 0.0f, clickCount, modifiers, timestamp);
 }
 
 WebWheelEvent WebEventFactory::createWebWheelEvent(QGraphicsSceneWheelEvent* e)
 {
-    int x                                   = e->pos().x();
-    int y                                   = e->pos().y();
-    int globalX                             = e->screenPos().x();
-    int globalY                             = e->screenPos().y();
     float deltaX                            = 0;
     float deltaY                            = 0;
     float wheelTicksX                       = 0;
@@ -149,7 +139,7 @@ WebWheelEvent WebEventFactory::createWebWheelEvent(QGraphicsSceneWheelEvent* e)
     deltaY *= (fullTick) ? QApplication::wheelScrollLines() * cDefaultQtScrollStep : 1;
 #endif
 
-    return WebWheelEvent(WebEvent::Wheel, x, y, globalX,  globalY, deltaX, deltaY, wheelTicksX, wheelTicksY, granularity, modifiers, timestamp);
+    return WebWheelEvent(WebEvent::Wheel, e->pos().toPoint(), e->screenPos(), FloatSize(deltaX, deltaY), FloatSize(wheelTicksX, wheelTicksY), granularity, modifiers, timestamp);
 }
 
 WebKeyboardEvent WebEventFactory::createWebKeyboardEvent(QKeyEvent* event)
@@ -203,11 +193,8 @@ WebTouchEvent WebEventFactory::createWebTouchEvent(QTouchEvent* event)
             break;
         }
 
-        m_touchPoints.append(WebPlatformTouchPoint(id, state, points.at(i).screenPos().toPoint().x(),
-            points.at(i).screenPos().toPoint().y(),
-            points.at(i).pos().toPoint().x(),
-            points.at(i).pos().toPoint().y()));
-        }
+        m_touchPoints.append(WebPlatformTouchPoint(id, state, points.at(i).screenPos().toPoint(), points.at(i).pos().toPoint()));
+    }
 
     bool m_ctrlKey = (event->modifiers() & Qt::ControlModifier);
     bool m_altKey = (event->modifiers() & Qt::AltModifier);
diff --git a/WebKit2/Shared/win/WebEventFactory.cpp b/WebKit2/Shared/win/WebEventFactory.cpp
index 22e5f1b..b242418 100644
--- a/WebKit2/Shared/win/WebEventFactory.cpp
+++ b/WebKit2/Shared/win/WebEventFactory.cpp
@@ -29,6 +29,8 @@
 #include <windowsx.h>
 #include <wtf/ASCIICType.h>
 
+using namespace WebCore;
+
 namespace WebKit {
 
 static const unsigned short HIGH_BIT_MASK_SHORT = 0x8000;
@@ -66,16 +68,15 @@ static int verticalScrollLines()
     return scrollLines;
 }
 
-static inline int clickCount(WebEvent::Type type, WebMouseEvent::Button button, int positionX, int positionY, double timeStampSeconds)
+static inline int clickCount(WebEvent::Type type, WebMouseEvent::Button button, const POINT& position, double timeStampSeconds)
 {
     static int gLastClickCount;
     static double gLastClickTime;
-    static int lastClickPositionX;
-    static int lastClickPositionY;
+    static POINT lastClickPosition;
     static WebMouseEvent::Button lastClickButton = WebMouseEvent::LeftButton;
 
-    bool cancelPreviousClick = (abs(lastClickPositionX - positionX) > (::GetSystemMetrics(SM_CXDOUBLECLK) / 2))
-                            || (abs(lastClickPositionY - positionY) > (::GetSystemMetrics(SM_CYDOUBLECLK) / 2))
+    bool cancelPreviousClick = (abs(lastClickPosition.x - position.x) > (::GetSystemMetrics(SM_CXDOUBLECLK) / 2))
+                            || (abs(lastClickPosition.y - position.y) > (::GetSystemMetrics(SM_CYDOUBLECLK) / 2))
                             || ((timeStampSeconds - gLastClickTime) * 1000.0 > ::GetDoubleClickTime());
 
     if (type == WebEvent::MouseDown) {
@@ -83,16 +84,15 @@ static inline int clickCount(WebEvent::Type type, WebMouseEvent::Button button,
             ++gLastClickCount;
         else {
             gLastClickCount = 1;
-            lastClickPositionX = positionX;
-            lastClickPositionY = positionY;
+            lastClickPosition = position;
         }
         gLastClickTime = timeStampSeconds;
         lastClickButton = button;
     } else if (type == WebEvent::MouseMove) {
         if (cancelPreviousClick) {
             gLastClickCount = 0;
-            lastClickPositionX = 0;
-            lastClickPositionY = 0;
+            lastClickPosition.x = 0;
+            lastClickPosition.y = 0;
             gLastClickTime = 0;
         }
     }
@@ -386,16 +386,12 @@ WebMouseEvent WebEventFactory::createWebMouseEvent(HWND hWnd, UINT message, WPAR
     POINT globalPosition = position;
     ::ClientToScreen(hWnd, &globalPosition);
 
-    int positionX = position.x;
-    int positionY = position.y;
-    int globalPositionX = globalPosition.x;
-    int globalPositionY = globalPosition.y;
     double timestamp = ::GetTickCount() * 0.001; // ::GetTickCount returns milliseconds (Chrome uses GetMessageTime() / 1000.0)
 
-    int clickCount = WebKit::clickCount(type, button, positionX, positionY, timestamp);
+    int clickCount = WebKit::clickCount(type, button, position, timestamp);
     WebEvent::Modifiers modifiers = modifiersForEvent(wParam);
 
-    return WebMouseEvent(type, button, positionX, positionY, globalPositionX, globalPositionY, 0, 0, 0, clickCount, modifiers, timestamp);
+    return WebMouseEvent(type, button, position, globalPosition, 0, 0, 0, clickCount, modifiers, timestamp);
 }
 
 WebWheelEvent WebEventFactory::createWebWheelEvent(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
@@ -407,11 +403,6 @@ WebWheelEvent WebEventFactory::createWebWheelEvent(HWND hWnd, UINT message, WPAR
     POINT position = globalPosition;
     ::ScreenToClient(hWnd, &position);
 
-    int positionX = position.x;
-    int positionY = position.y;
-    int globalPositionX = globalPosition.x;
-    int globalPositionY = globalPosition.y;
-
     WebWheelEvent::Granularity granularity  = WebWheelEvent::ScrollByPixelWheelEvent;
 
     WebEvent::Modifiers modifiers = modifiersForEvent(wParam);
@@ -448,7 +439,7 @@ WebWheelEvent WebEventFactory::createWebWheelEvent(HWND hWnd, UINT message, WPAR
         }
     }
 
-    return WebWheelEvent(WebEvent::Wheel, positionX, positionY, globalPositionX, globalPositionY, deltaX, deltaY, wheelTicksX, wheelTicksY, granularity, modifiers, timestamp);
+    return WebWheelEvent(WebEvent::Wheel, position, globalPosition, FloatSize(deltaX, deltaY), FloatSize(wheelTicksX, wheelTicksY), granularity, modifiers, timestamp);
 }
 
 WebKeyboardEvent WebEventFactory::createWebKeyboardEvent(HWND hwnd, UINT message, WPARAM wparam, LPARAM lparam)
diff --git a/WebKit2/WebProcess/Plugins/Netscape/mac/NetscapePluginMac.mm b/WebKit2/WebProcess/Plugins/Netscape/mac/NetscapePluginMac.mm
index 1d908d8..a872070 100644
--- a/WebKit2/WebProcess/Plugins/Netscape/mac/NetscapePluginMac.mm
+++ b/WebKit2/WebProcess/Plugins/Netscape/mac/NetscapePluginMac.mm
@@ -329,8 +329,8 @@ static int32_t buttonNumber(WebMouseEvent::Button button)
 static void fillInCocoaEventFromMouseEvent(NPCocoaEvent& event, const WebMouseEvent& mouseEvent, const WebCore::IntPoint& pluginLocation)
 {
     event.data.mouse.modifierFlags = modifierFlags(mouseEvent);
-    event.data.mouse.pluginX = mouseEvent.positionX() - pluginLocation.x();
-    event.data.mouse.pluginY = mouseEvent.positionY() - pluginLocation.y();
+    event.data.mouse.pluginX = mouseEvent.position().x() - pluginLocation.x();
+    event.data.mouse.pluginY = mouseEvent.position().y() - pluginLocation.y();
     event.data.mouse.buttonNumber = buttonNumber(mouseEvent.button());
     event.data.mouse.clickCount = mouseEvent.clickCount();
     event.data.mouse.deltaX = mouseEvent.deltaX();
@@ -413,12 +413,12 @@ bool NetscapePlugin::platformHandleWheelEvent(const WebWheelEvent& wheelEvent)
             NPCocoaEvent event = initializeEvent(NPCocoaEventScrollWheel);
             
             event.data.mouse.modifierFlags = modifierFlags(wheelEvent);
-            event.data.mouse.pluginX = wheelEvent.positionX() - m_frameRect.x();
-            event.data.mouse.pluginY = wheelEvent.positionY() - m_frameRect.y();
+            event.data.mouse.pluginX = wheelEvent.position().x() - m_frameRect.x();
+            event.data.mouse.pluginY = wheelEvent.position().y() - m_frameRect.y();
             event.data.mouse.buttonNumber = 0;
             event.data.mouse.clickCount = 0;
-            event.data.mouse.deltaX = wheelEvent.deltaX();
-            event.data.mouse.deltaY = wheelEvent.deltaY();
+            event.data.mouse.deltaX = wheelEvent.delta().width();
+            event.data.mouse.deltaY = wheelEvent.delta().height();
             event.data.mouse.deltaZ = 0;
             return NPP_HandleEvent(&event);
         }
diff --git a/WebKit2/WebProcess/Plugins/Netscape/win/NetscapePluginWin.cpp b/WebKit2/WebProcess/Plugins/Netscape/win/NetscapePluginWin.cpp
index db11d27..35ee6e0 100644
--- a/WebKit2/WebProcess/Plugins/Netscape/win/NetscapePluginWin.cpp
+++ b/WebKit2/WebProcess/Plugins/Netscape/win/NetscapePluginWin.cpp
@@ -165,7 +165,7 @@ NPEvent toNP(const WebMouseEvent& event)
     if (event.shiftKey())
         npEvent.wParam |= MK_SHIFT;
 
-    npEvent.lParam = MAKELPARAM(event.positionX(), event.positionY());
+    npEvent.lParam = MAKELPARAM(event.position().x(), event.position().y());
 
     switch (event.type()) {
     case WebEvent::MouseMove:

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list