Index: Source/core/dom/WheelEvent.h |
diff --git a/Source/core/dom/WheelEvent.h b/Source/core/dom/WheelEvent.h |
index ba17ab4ad2432fd22dcc01ebb32b281692cc6be6..9999c591520f7d28620c8ce3a1142d1129faf0a5 100644 |
--- a/Source/core/dom/WheelEvent.h |
+++ b/Source/core/dom/WheelEvent.h |
@@ -3,6 +3,7 @@ |
* Copyright (C) 2001 Tobias Anton (anton@stud.fbi.fh-darmstadt.de) |
* Copyright (C) 2006 Samuel Weinig (sam.weinig@gmail.com) |
* Copyright (C) 2003, 2004, 2005, 2006, 2008, 2010 Apple Inc. All rights reserved. |
+ * Copyright (C) 2013 Samsung Electronics. All rights reserved. |
* |
* This library is free software; you can redistribute it and/or |
* modify it under the terms of the GNU Library General Public |
@@ -35,14 +36,20 @@ class PlatformWheelEvent; |
struct WheelEventInit : public MouseEventInit { |
WheelEventInit(); |
- int wheelDeltaX; |
- int wheelDeltaY; |
+ double deltaX; |
+ double deltaY; |
+ double deltaZ; |
+ int wheelDeltaX; // Deprecated. |
+ int wheelDeltaY; // Deprecated. |
unsigned deltaMode; |
}; |
class WheelEvent : public MouseEvent { |
public: |
- enum { TickMultiplier = 120 }; |
+ enum { |
+ TickMultiplier = 100, // Synced with Firefox. |
+ LegacyTickMultiplier = 120 |
+ }; |
enum DeltaMode { |
DOM_DELTA_PIXEL = 0, |
@@ -77,9 +84,12 @@ public: |
int screenX, int screenY, int pageX, int pageY, |
bool ctrlKey, bool altKey, bool shiftKey, bool metaKey); |
- int wheelDelta() const { return m_wheelDelta.y() ? m_wheelDelta.y() : m_wheelDelta.x(); } |
- int wheelDeltaX() const { return m_wheelDelta.x(); } |
- int wheelDeltaY() const { return m_wheelDelta.y(); } |
+ int wheelDelta() const { return wheelDeltaY() ? wheelDeltaY() : wheelDeltaX(); } |
+ double deltaX() const { return m_ticksX * TickMultiplier; } |
+ double deltaY() const { return m_ticksY * TickMultiplier; } |
+ double deltaZ() const { return m_ticksZ * TickMultiplier; } |
+ int wheelDeltaX() const { return round(m_ticksX * LegacyTickMultiplier); } // Deprecated. |
+ int wheelDeltaY() const { return round(m_ticksY * LegacyTickMultiplier); } // Deprecated. |
int rawDeltaX() const { return m_rawDelta.x(); } |
int rawDeltaY() const { return m_rawDelta.y(); } |
unsigned deltaMode() const { return m_deltaMode; } |
@@ -96,7 +106,9 @@ private: |
unsigned, PassRefPtr<AbstractView>, const IntPoint& screenLocation, const IntPoint& pageLocation, |
bool ctrlKey, bool altKey, bool shiftKey, bool metaKey, bool directionInvertedFromDevice); |
- IntPoint m_wheelDelta; |
+ double m_ticksX; |
+ double m_ticksY; |
+ double m_ticksZ; |
IntPoint m_rawDelta; |
unsigned m_deltaMode; |
bool m_directionInvertedFromDevice; |