Changeset 141394 in webkit
- Timestamp:
- Jan 31, 2013 3:10:44 AM (11 years ago)
- Location:
- trunk/Source
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r141393 r141394 1 2013-01-31 Kentaro Hara <haraken@chromium.org> 2 3 Rename WheelEvent::Granularity to WheelEvent::DeltaMode 4 https://bugs.webkit.org/show_bug.cgi?id=108434 5 6 Reviewed by Ryosuke Niwa. 7 8 Per the spec, WheelEvent::Granularity should be renamed to WheelEvent::DeltaMode. 9 10 Spec: http://www.w3.org/TR/DOM-Level-3-Events/#events-WheelEvent 11 https://dvcs.w3.org/hg/d4e/raw-file/tip/source_respec.htm#constructor-wheelevent 12 13 No tests. No change in behavior. 14 15 * dom/WheelEvent.cpp: 16 (WebCore::WheelEvent::WheelEvent): 17 (WebCore::WheelEvent::initWheelEvent): 18 (WebCore::deltaMode): 19 (WebCore::WheelEventDispatchMediator::WheelEventDispatchMediator): 20 * dom/WheelEvent.h: 21 (WebCore::WheelEvent::create): 22 (WebCore::WheelEvent::deltaMode): 23 (WheelEvent): 24 * page/EventHandler.cpp: 25 (WebCore::wheelGranularityToScrollGranularity): 26 (WebCore::EventHandler::defaultWheelEventHandler): 27 1 28 2013-01-30 Yury Semikhatsky <yurys@chromium.org> 2 29 -
trunk/Source/WebCore/dom/WheelEvent.cpp
r141318 r141394 39 39 40 40 WheelEvent::WheelEvent() 41 : m_ granularity(Pixel)41 : m_deltaMode(DOMDeltaPixel) 42 42 , m_directionInvertedFromDevice(false) 43 43 { … … 50 50 } 51 51 52 WheelEvent::WheelEvent(const FloatPoint& wheelTicks, const FloatPoint& rawDelta, 53 Granularity granularity, PassRefPtr<AbstractView> view, 54 const IntPoint& screenLocation, const IntPoint& pageLocation, 55 bool ctrlKey, bool altKey, bool shiftKey, bool metaKey, 56 bool directionInvertedFromDevice) 52 WheelEvent::WheelEvent(const FloatPoint& wheelTicks, const FloatPoint& rawDelta, DeltaMode deltaMode, 53 PassRefPtr<AbstractView> view, const IntPoint& screenLocation, const IntPoint& pageLocation, 54 bool ctrlKey, bool altKey, bool shiftKey, bool metaKey, bool directionInvertedFromDevice) 57 55 : MouseEvent(eventNames().mousewheelEvent, 58 56 true, true, view, 0, screenLocation.x(), screenLocation.y(), … … 64 62 , m_wheelDelta(IntPoint(static_cast<int>(wheelTicks.x() * TickMultiplier), static_cast<int>(wheelTicks.y() * TickMultiplier))) 65 63 , m_rawDelta(roundedIntPoint(rawDelta)) 66 , m_ granularity(granularity)64 , m_deltaMode(deltaMode) 67 65 , m_directionInvertedFromDevice(directionInvertedFromDevice) 68 66 { … … 88 86 89 87 m_rawDelta = IntPoint(rawDeltaX, rawDeltaY); 90 m_ granularity =Pixel;88 m_deltaMode = DOMDeltaPixel; 91 89 m_directionInvertedFromDevice = false; 92 90 … … 112 110 } 113 111 114 inline static WheelEvent:: Granularity granularity(const PlatformWheelEvent& event)112 inline static WheelEvent::DeltaMode deltaMode(const PlatformWheelEvent& event) 115 113 { 116 return event.granularity() == ScrollByPageWheelEvent ? WheelEvent:: Page : WheelEvent::Pixel;114 return event.granularity() == ScrollByPageWheelEvent ? WheelEvent::DOMDeltaPage : WheelEvent::DOMDeltaPixel; 117 115 } 118 116 … … 128 126 129 127 setEvent(WheelEvent::create(FloatPoint(event.wheelTicksX(), event.wheelTicksY()), FloatPoint(event.deltaX(), event.deltaY()), 130 granularity(event), view, event.globalPosition(), event.position(),131 128 deltaMode(event), view, event.globalPosition(), event.position(), 129 event.ctrlKey(), event.altKey(), event.shiftKey(), event.metaKey(), event.directionInvertedFromDevice())); 132 130 } 133 131 -
trunk/Source/WebCore/dom/WheelEvent.h
r141318 r141394 42 42 enum { TickMultiplier = 120 }; 43 43 44 enum Granularity { Pixel, Line,Page };44 enum DeltaMode { DOMDeltaPixel, DOMDeltaLine, DOMDeltaPage }; 45 45 46 46 static PassRefPtr<WheelEvent> create() … … 55 55 56 56 static PassRefPtr<WheelEvent> create(const FloatPoint& wheelTicks, 57 const FloatPoint& rawDelta, Granularity granularity, PassRefPtr<AbstractView> view,57 const FloatPoint& rawDelta, DeltaMode deltaMode, PassRefPtr<AbstractView> view, 58 58 const IntPoint& screenLocation, const IntPoint& pageLocation, 59 59 bool ctrlKey, bool altKey, bool shiftKey, bool metaKey, bool directionInvertedFromDevice) 60 60 { 61 return adoptRef(new WheelEvent(wheelTicks, rawDelta, granularity, view,61 return adoptRef(new WheelEvent(wheelTicks, rawDelta, deltaMode, view, 62 62 screenLocation, pageLocation, ctrlKey, altKey, shiftKey, metaKey, directionInvertedFromDevice)); 63 63 } … … 76 76 int rawDeltaX() const { return m_rawDelta.x(); } 77 77 int rawDeltaY() const { return m_rawDelta.y(); } 78 Granularity granularity() const { return m_granularity; }78 DeltaMode deltaMode() const { return m_deltaMode; } 79 79 80 80 bool webkitDirectionInvertedFromDevice() const { return m_directionInvertedFromDevice; } … … 89 89 WheelEvent(const AtomicString&, const WheelEventInit&); 90 90 WheelEvent(const FloatPoint& wheelTicks, const FloatPoint& rawDelta, 91 Granularity, PassRefPtr<AbstractView>,91 DeltaMode, PassRefPtr<AbstractView>, 92 92 const IntPoint& screenLocation, const IntPoint& pageLocation, 93 93 bool ctrlKey, bool altKey, bool shiftKey, bool metaKey, bool directionInvertedFromDevice); … … 95 95 IntPoint m_wheelDelta; 96 96 IntPoint m_rawDelta; 97 Granularity m_granularity;97 DeltaMode m_deltaMode; 98 98 bool m_directionInvertedFromDevice; 99 99 }; -
trunk/Source/WebCore/page/EventHandler.cpp
r141088 r141394 252 252 #endif 253 253 254 static inline ScrollGranularity wheelGranularityToScrollGranularity(WheelEvent:: Granularity granularity)255 { 256 switch ( granularity) {257 case WheelEvent:: Page:254 static inline ScrollGranularity wheelGranularityToScrollGranularity(WheelEvent::DeltaMode deltaMode) 255 { 256 switch (deltaMode) { 257 case WheelEvent::DOMDeltaPage: 258 258 return ScrollByPage; 259 case WheelEvent:: Line:259 case WheelEvent::DOMDeltaLine: 260 260 return ScrollByLine; 261 case WheelEvent:: Pixel:261 case WheelEvent::DOMDeltaPixel: 262 262 return ScrollByPixel; 263 263 } … … 2390 2390 2391 2391 Node* stopNode = m_previousWheelScrolledNode.get(); 2392 ScrollGranularity granularity = wheelGranularityToScrollGranularity(wheelEvent-> granularity());2392 ScrollGranularity granularity = wheelGranularityToScrollGranularity(wheelEvent->deltaMode()); 2393 2393 2394 2394 // Break up into two scrolls if we need to. Diagonal movement on -
trunk/Source/WebKit/chromium/ChangeLog
r141391 r141394 1 2013-01-31 Kentaro Hara <haraken@chromium.org> 2 3 Rename WheelEvent::Granularity to WheelEvent::DeltaMode 4 https://bugs.webkit.org/show_bug.cgi?id=108434 5 6 Reviewed by Ryosuke Niwa. 7 8 Per the spec, WheelEvent::Granularity should be renamed to WheelEvent::DeltaMode. 9 10 Spec: http://www.w3.org/TR/DOM-Level-3-Events/#events-WheelEvent 11 https://dvcs.w3.org/hg/d4e/raw-file/tip/source_respec.htm#constructor-wheelevent 12 13 No tests. No change in behavior. 14 15 * src/WebInputEventConversion.cpp: 16 (WebKit::PlatformWheelEventBuilder::PlatformWheelEventBuilder): 17 (WebKit::WebMouseWheelEventBuilder::WebMouseWheelEventBuilder): 18 1 19 2013-01-31 Yury Semikhatsky <yurys@chromium.org> 2 20 -
trunk/Source/WebKit/chromium/src/WebInputEventConversion.cpp
r141346 r141394 518 518 wheelTicksX = static_cast<float>(event.wheelDeltaX()) / 120; 519 519 wheelTicksY = static_cast<float>(event.wheelDeltaY()) / 120; 520 scrollByPage = event. granularity() == WheelEvent::Page;520 scrollByPage = event.deltaMode() == WheelEvent::DOMDeltaPage; 521 521 } 522 522
Note: See TracChangeset
for help on using the changeset viewer.