Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(180)

Side by Side Diff: Source/core/dom/WheelEvent.h

Issue 23034006: WheelEvent's deltaX/deltaY should report real amount of pixels scrolled (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: No Change Created 7 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « LayoutTests/fast/events/wheelevent-basic-expected.txt ('k') | Source/core/dom/WheelEvent.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2001 Peter Kelly (pmk@post.com) 2 * Copyright (C) 2001 Peter Kelly (pmk@post.com)
3 * Copyright (C) 2001 Tobias Anton (anton@stud.fbi.fh-darmstadt.de) 3 * Copyright (C) 2001 Tobias Anton (anton@stud.fbi.fh-darmstadt.de)
4 * Copyright (C) 2006 Samuel Weinig (sam.weinig@gmail.com) 4 * Copyright (C) 2006 Samuel Weinig (sam.weinig@gmail.com)
5 * Copyright (C) 2003, 2004, 2005, 2006, 2008, 2010 Apple Inc. All rights reserv ed. 5 * Copyright (C) 2003, 2004, 2005, 2006, 2008, 2010 Apple Inc. All rights reserv ed.
6 * Copyright (C) 2013 Samsung Electronics. All rights reserved. 6 * Copyright (C) 2013 Samsung Electronics. All rights reserved.
7 * 7 *
8 * This library is free software; you can redistribute it and/or 8 * This library is free software; you can redistribute it and/or
9 * modify it under the terms of the GNU Library General Public 9 * modify it under the terms of the GNU Library General Public
10 * License as published by the Free Software Foundation; either 10 * License as published by the Free Software Foundation; either
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after
78 bool ctrlKey, bool altKey, bool shiftKey, bool metaKey); 78 bool ctrlKey, bool altKey, bool shiftKey, bool metaKey);
79 79
80 void initWebKitWheelEvent(int rawDeltaX, int rawDeltaY, PassRefPtr<AbstractV iew>, 80 void initWebKitWheelEvent(int rawDeltaX, int rawDeltaY, PassRefPtr<AbstractV iew>,
81 int screenX, int screenY, int pageX, int pageY, 81 int screenX, int screenY, int pageX, int pageY,
82 bool ctrlKey, bool altKey, bool shiftKey, bool metaKey); 82 bool ctrlKey, bool altKey, bool shiftKey, bool metaKey);
83 83
84 double deltaX() const { return m_deltaX; } // Positive when scrolling right. 84 double deltaX() const { return m_deltaX; } // Positive when scrolling right.
85 double deltaY() const { return m_deltaY; } // Positive when scrolling down. 85 double deltaY() const { return m_deltaY; } // Positive when scrolling down.
86 double deltaZ() const { return m_deltaZ; } 86 double deltaZ() const { return m_deltaZ; }
87 int wheelDelta() const { return wheelDeltaY() ? wheelDeltaY() : wheelDeltaX( ); } // Deprecated. 87 int wheelDelta() const { return wheelDeltaY() ? wheelDeltaY() : wheelDeltaX( ); } // Deprecated.
88 int wheelDeltaX() const { return -m_deltaX; } // Deprecated, negative when s crolling right. 88 int wheelDeltaX() const { return m_wheelDelta.x(); } // Deprecated, negative when scrolling right.
89 int wheelDeltaY() const { return -m_deltaY; } // Deprecated, negative when s crolling down. 89 int wheelDeltaY() const { return m_wheelDelta.y(); } // Deprecated, negative when scrolling down.
90 int rawDeltaX() const { return m_rawDelta.x(); }
91 int rawDeltaY() const { return m_rawDelta.y(); }
92 unsigned deltaMode() const { return m_deltaMode; } 90 unsigned deltaMode() const { return m_deltaMode; }
91 float ticksX() const { return static_cast<float>(m_wheelDelta.x()) / TickMul tiplier; }
92 float ticksY() const { return static_cast<float>(m_wheelDelta.y()) / TickMul tiplier; }
93 93
94 bool webkitDirectionInvertedFromDevice() const { return m_directionInvertedF romDevice; } 94 bool webkitDirectionInvertedFromDevice() const { return m_directionInvertedF romDevice; }
95 95
96 virtual const AtomicString& interfaceName() const; 96 virtual const AtomicString& interfaceName() const;
97 virtual bool isMouseEvent() const; 97 virtual bool isMouseEvent() const;
98 98
99 private: 99 private:
100 WheelEvent(); 100 WheelEvent();
101 WheelEvent(const AtomicString&, const WheelEventInit&); 101 WheelEvent(const AtomicString&, const WheelEventInit&);
102 WheelEvent(const FloatPoint& wheelTicks, const FloatPoint& rawDelta, 102 WheelEvent(const FloatPoint& wheelTicks, const FloatPoint& rawDelta,
103 unsigned, PassRefPtr<AbstractView>, const IntPoint& screenLocation, cons t IntPoint& pageLocation, 103 unsigned, PassRefPtr<AbstractView>, const IntPoint& screenLocation, cons t IntPoint& pageLocation,
104 bool ctrlKey, bool altKey, bool shiftKey, bool metaKey, bool directionIn vertedFromDevice); 104 bool ctrlKey, bool altKey, bool shiftKey, bool metaKey, bool directionIn vertedFromDevice);
105 105
106 IntPoint m_wheelDelta;
106 double m_deltaX; 107 double m_deltaX;
107 double m_deltaY; 108 double m_deltaY;
108 double m_deltaZ; 109 double m_deltaZ;
109 IntPoint m_rawDelta;
110 unsigned m_deltaMode; 110 unsigned m_deltaMode;
111 bool m_directionInvertedFromDevice; 111 bool m_directionInvertedFromDevice;
112 }; 112 };
113 113
114 class WheelEventDispatchMediator : public EventDispatchMediator { 114 class WheelEventDispatchMediator : public EventDispatchMediator {
115 public: 115 public:
116 static PassRefPtr<WheelEventDispatchMediator> create(const PlatformWheelEven t&, PassRefPtr<AbstractView>); 116 static PassRefPtr<WheelEventDispatchMediator> create(const PlatformWheelEven t&, PassRefPtr<AbstractView>);
117 private: 117 private:
118 WheelEventDispatchMediator(const PlatformWheelEvent&, PassRefPtr<AbstractVie w>); 118 WheelEventDispatchMediator(const PlatformWheelEvent&, PassRefPtr<AbstractVie w>);
119 WheelEvent* event() const; 119 WheelEvent* event() const;
120 virtual bool dispatchEvent(EventDispatcher*) const OVERRIDE; 120 virtual bool dispatchEvent(EventDispatcher*) const OVERRIDE;
121 }; 121 };
122 122
123 } // namespace WebCore 123 } // namespace WebCore
124 124
125 #endif // WheelEvent_h 125 #endif // WheelEvent_h
OLDNEW
« no previous file with comments | « LayoutTests/fast/events/wheelevent-basic-expected.txt ('k') | Source/core/dom/WheelEvent.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698