Changeset 171685 in webkit
- Timestamp:
- Jul 28, 2014 12:35:48 PM (10 years ago)
- Location:
- trunk/Source/WebCore
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r171678 r171685 1 2014-07-28 Wenson Hsieh <wenson_hsieh@apple.com> 2 3 Let WheelEvent wrap a PlatformWheelEvent 4 https://bugs.webkit.org/show_bug.cgi?id=135244 5 6 WheelEvent now wraps a PlatformWheelEvent. m_directionInvertedFromDevice, as well as m_phase and m_momentumPhase 7 have been removed, since the information is redundant in PlatformWheelEvent. Note that deltaX and deltaY have 8 NOT been replaced, since we need double precision instead of float precision. 9 10 Reviewed by Beth Dakin. 11 12 No new tests, since behavior should not have changed. 13 14 * dom/WheelEvent.cpp: 15 (WebCore::WheelEvent::WheelEvent): 16 (WebCore::WheelEvent::initWheelEvent): 17 * dom/WheelEvent.h: 18 (WebCore::WheelEvent::wheelEvent): Returns a non-null pointer to the PlatformWheelEvent iff WheelEvent was initialized by PlatformWheelEvent. 19 (WebCore::WheelEvent::webkitDirectionInvertedFromDevice): Updated to use PlatformWheelEvent. 20 (WebCore::WheelEvent::phase): Updated to use PlatformWheelEvent. 21 (WebCore::WheelEvent::momentumPhase): Updated to use PlatformWheelEvent. 22 1 23 2014-07-28 Brent Fulgham <bfulgham@apple.com> 2 24 -
trunk/Source/WebCore/dom/WheelEvent.cpp
r171531 r171685 51 51 , m_deltaZ(0) 52 52 , m_deltaMode(DOM_DELTA_PIXEL) 53 , m_ directionInvertedFromDevice(false)53 , m_initializedWithPlatformWheelEvent(false) 54 54 { 55 55 } … … 62 62 , m_deltaZ(initializer.deltaZ) 63 63 , m_deltaMode(initializer.deltaMode) 64 , m_initializedWithPlatformWheelEvent(false) 64 65 { 65 66 } … … 76 77 , m_deltaZ(0) 77 78 , m_deltaMode(determineDeltaMode(event)) 78 , m_directionInvertedFromDevice(event.directionInvertedFromDevice()) 79 , m_wheelEvent(std::make_unique<PlatformWheelEvent>(event)) 80 #if PLATFORM(MAC) 81 , m_phase(event.phase()) 82 , m_momentumPhase(event.momentumPhase()) 83 #endif 79 , m_wheelEvent(event) 80 , m_initializedWithPlatformWheelEvent(true) 84 81 { 85 82 } … … 104 101 105 102 m_deltaMode = DOM_DELTA_PIXEL; 106 m_directionInvertedFromDevice = false;107 103 108 104 initCoordinates(IntPoint(pageX, pageY)); -
trunk/Source/WebCore/dom/WheelEvent.h
r171531 r171685 78 78 bool ctrlKey, bool altKey, bool shiftKey, bool metaKey); 79 79 80 const PlatformWheelEvent* wheelEvent() const { return m_ wheelEvent.get(); }80 const PlatformWheelEvent* wheelEvent() const { return m_initializedWithPlatformWheelEvent ? &m_wheelEvent : nullptr; } 81 81 double deltaX() const { return m_deltaX; } // Positive when scrolling right. 82 82 double deltaY() const { return m_deltaY; } // Positive when scrolling down. … … 87 87 unsigned deltaMode() const { return m_deltaMode; } 88 88 89 bool webkitDirectionInvertedFromDevice() const { return m_ directionInvertedFromDevice; }89 bool webkitDirectionInvertedFromDevice() const { return m_wheelEvent.directionInvertedFromDevice(); } 90 90 // Needed for Objective-C legacy support 91 91 bool isHorizontal() const { return m_wheelDelta.x(); } … … 95 95 96 96 #if PLATFORM(MAC) 97 PlatformWheelEventPhase phase() const { return m_ phase; }98 PlatformWheelEventPhase momentumPhase() const { return m_ momentumPhase; }97 PlatformWheelEventPhase phase() const { return m_wheelEvent.phase(); } 98 PlatformWheelEventPhase momentumPhase() const { return m_wheelEvent.momentumPhase(); } 99 99 #endif 100 100 … … 111 111 double m_deltaZ; 112 112 unsigned m_deltaMode; 113 bool m_directionInvertedFromDevice; 114 std::unique_ptr<PlatformWheelEvent> m_wheelEvent; 115 116 #if PLATFORM(MAC) 117 PlatformWheelEventPhase m_phase; 118 PlatformWheelEventPhase m_momentumPhase; 119 #endif 113 PlatformWheelEvent m_wheelEvent; 114 bool m_initializedWithPlatformWheelEvent; 120 115 }; 121 116
Note: See TracChangeset
for help on using the changeset viewer.