Title: [141394] trunk/Source
Revision
141394
Author
[email protected]
Date
2013-01-31 03:10:44 -0800 (Thu, 31 Jan 2013)

Log Message

Rename WheelEvent::Granularity to WheelEvent::DeltaMode
https://bugs.webkit.org/show_bug.cgi?id=108434

Reviewed by Ryosuke Niwa.

Per the spec, WheelEvent::Granularity should be renamed to WheelEvent::DeltaMode.

Spec: http://www.w3.org/TR/DOM-Level-3-Events/#events-WheelEvent
https://dvcs.w3.org/hg/d4e/raw-file/tip/source_respec.htm#constructor-wheelevent

No tests. No change in behavior.

Source/WebCore:

* dom/WheelEvent.cpp:
(WebCore::WheelEvent::WheelEvent):
(WebCore::WheelEvent::initWheelEvent):
(WebCore::deltaMode):
(WebCore::WheelEventDispatchMediator::WheelEventDispatchMediator):
* dom/WheelEvent.h:
(WebCore::WheelEvent::create):
(WebCore::WheelEvent::deltaMode):
(WheelEvent):
* page/EventHandler.cpp:
(WebCore::wheelGranularityToScrollGranularity):
(WebCore::EventHandler::defaultWheelEventHandler):

Source/WebKit/chromium:

* src/WebInputEventConversion.cpp:
(WebKit::PlatformWheelEventBuilder::PlatformWheelEventBuilder):
(WebKit::WebMouseWheelEventBuilder::WebMouseWheelEventBuilder):

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (141393 => 141394)


--- trunk/Source/WebCore/ChangeLog	2013-01-31 10:52:41 UTC (rev 141393)
+++ trunk/Source/WebCore/ChangeLog	2013-01-31 11:10:44 UTC (rev 141394)
@@ -1,3 +1,30 @@
+2013-01-31  Kentaro Hara  <[email protected]>
+
+        Rename WheelEvent::Granularity to WheelEvent::DeltaMode
+        https://bugs.webkit.org/show_bug.cgi?id=108434
+
+        Reviewed by Ryosuke Niwa.
+
+        Per the spec, WheelEvent::Granularity should be renamed to WheelEvent::DeltaMode.
+
+        Spec: http://www.w3.org/TR/DOM-Level-3-Events/#events-WheelEvent
+        https://dvcs.w3.org/hg/d4e/raw-file/tip/source_respec.htm#constructor-wheelevent
+
+        No tests. No change in behavior.
+
+        * dom/WheelEvent.cpp:
+        (WebCore::WheelEvent::WheelEvent):
+        (WebCore::WheelEvent::initWheelEvent):
+        (WebCore::deltaMode):
+        (WebCore::WheelEventDispatchMediator::WheelEventDispatchMediator):
+        * dom/WheelEvent.h:
+        (WebCore::WheelEvent::create):
+        (WebCore::WheelEvent::deltaMode):
+        (WheelEvent):
+        * page/EventHandler.cpp:
+        (WebCore::wheelGranularityToScrollGranularity):
+        (WebCore::EventHandler::defaultWheelEventHandler):
+
 2013-01-30  Yury Semikhatsky  <[email protected]>
 
         Web Inspector: test that nodes from the same detached DOM tree will get into one group in heap snapshot

Modified: trunk/Source/WebCore/dom/WheelEvent.cpp (141393 => 141394)


--- trunk/Source/WebCore/dom/WheelEvent.cpp	2013-01-31 10:52:41 UTC (rev 141393)
+++ trunk/Source/WebCore/dom/WheelEvent.cpp	2013-01-31 11:10:44 UTC (rev 141394)
@@ -38,7 +38,7 @@
 }
 
 WheelEvent::WheelEvent()
-    : m_granularity(Pixel)
+    : m_deltaMode(DOMDeltaPixel)
     , m_directionInvertedFromDevice(false)
 {
 }
@@ -49,11 +49,9 @@
 {
 }
 
-WheelEvent::WheelEvent(const FloatPoint& wheelTicks, const FloatPoint& rawDelta,
-                       Granularity granularity, PassRefPtr<AbstractView> view,
-                       const IntPoint& screenLocation, const IntPoint& pageLocation,
-                       bool ctrlKey, bool altKey, bool shiftKey, bool metaKey,
-                       bool directionInvertedFromDevice)
+WheelEvent::WheelEvent(const FloatPoint& wheelTicks, const FloatPoint& rawDelta, DeltaMode deltaMode,
+    PassRefPtr<AbstractView> view, const IntPoint& screenLocation, const IntPoint& pageLocation,
+    bool ctrlKey, bool altKey, bool shiftKey, bool metaKey, bool directionInvertedFromDevice)
     : MouseEvent(eventNames().mousewheelEvent,
                  true, true, view, 0, screenLocation.x(), screenLocation.y(),
                  pageLocation.x(), pageLocation.y(),
@@ -63,7 +61,7 @@
                  ctrlKey, altKey, shiftKey, metaKey, 0, 0, 0, false)
     , m_wheelDelta(IntPoint(static_cast<int>(wheelTicks.x() * TickMultiplier), static_cast<int>(wheelTicks.y() * TickMultiplier)))
     , m_rawDelta(roundedIntPoint(rawDelta))
-    , m_granularity(granularity)
+    , m_deltaMode(deltaMode)
     , m_directionInvertedFromDevice(directionInvertedFromDevice)
 {
 }
@@ -87,7 +85,7 @@
     m_wheelDelta = IntPoint(rawDeltaX * TickMultiplier, rawDeltaY * TickMultiplier);
     
     m_rawDelta = IntPoint(rawDeltaX, rawDeltaY);
-    m_granularity = Pixel;
+    m_deltaMode = DOMDeltaPixel;
     m_directionInvertedFromDevice = false;
 
     initCoordinates(IntPoint(pageX, pageY));
@@ -111,9 +109,9 @@
     return false;
 }
 
-inline static WheelEvent::Granularity granularity(const PlatformWheelEvent& event)
+inline static WheelEvent::DeltaMode deltaMode(const PlatformWheelEvent& event)
 {
-    return event.granularity() == ScrollByPageWheelEvent ? WheelEvent::Page : WheelEvent::Pixel;
+    return event.granularity() == ScrollByPageWheelEvent ? WheelEvent::DOMDeltaPage : WheelEvent::DOMDeltaPixel;
 }
 
 PassRefPtr<WheelEventDispatchMediator> WheelEventDispatchMediator::create(const PlatformWheelEvent& event, PassRefPtr<AbstractView> view)
@@ -127,8 +125,8 @@
         return;
 
     setEvent(WheelEvent::create(FloatPoint(event.wheelTicksX(), event.wheelTicksY()), FloatPoint(event.deltaX(), event.deltaY()),
-                                granularity(event), view, event.globalPosition(), event.position(),
-                                event.ctrlKey(), event.altKey(), event.shiftKey(), event.metaKey(), event.directionInvertedFromDevice()));
+        deltaMode(event), view, event.globalPosition(), event.position(),
+        event.ctrlKey(), event.altKey(), event.shiftKey(), event.metaKey(), event.directionInvertedFromDevice()));
 }
 
 WheelEvent* WheelEventDispatchMediator::event() const

Modified: trunk/Source/WebCore/dom/WheelEvent.h (141393 => 141394)


--- trunk/Source/WebCore/dom/WheelEvent.h	2013-01-31 10:52:41 UTC (rev 141393)
+++ trunk/Source/WebCore/dom/WheelEvent.h	2013-01-31 11:10:44 UTC (rev 141394)
@@ -41,7 +41,7 @@
 public:
     enum { TickMultiplier = 120 };
 
-    enum Granularity { Pixel, Line, Page };
+    enum DeltaMode { DOMDeltaPixel, DOMDeltaLine, DOMDeltaPage };
 
     static PassRefPtr<WheelEvent> create()
     {
@@ -54,11 +54,11 @@
     }
 
     static PassRefPtr<WheelEvent> create(const FloatPoint& wheelTicks,
-        const FloatPoint& rawDelta, Granularity granularity, PassRefPtr<AbstractView> view,
+        const FloatPoint& rawDelta, DeltaMode deltaMode, PassRefPtr<AbstractView> view,
         const IntPoint& screenLocation, const IntPoint& pageLocation,
         bool ctrlKey, bool altKey, bool shiftKey, bool metaKey, bool directionInvertedFromDevice)
     {
-        return adoptRef(new WheelEvent(wheelTicks, rawDelta, granularity, view,
+        return adoptRef(new WheelEvent(wheelTicks, rawDelta, deltaMode, view,
         screenLocation, pageLocation, ctrlKey, altKey, shiftKey, metaKey, directionInvertedFromDevice));
     }
 
@@ -75,7 +75,7 @@
     int wheelDeltaY() const { return m_wheelDelta.y(); }
     int rawDeltaX() const { return m_rawDelta.x(); }
     int rawDeltaY() const { return m_rawDelta.y(); }
-    Granularity granularity() const { return m_granularity; }
+    DeltaMode deltaMode() const { return m_deltaMode; }
 
     bool webkitDirectionInvertedFromDevice() const { return m_directionInvertedFromDevice; }
     // Needed for Objective-C legacy support
@@ -88,13 +88,13 @@
     WheelEvent();
     WheelEvent(const AtomicString&, const WheelEventInit&);
     WheelEvent(const FloatPoint& wheelTicks, const FloatPoint& rawDelta,
-        Granularity, PassRefPtr<AbstractView>,
+        DeltaMode, PassRefPtr<AbstractView>,
         const IntPoint& screenLocation, const IntPoint& pageLocation,
         bool ctrlKey, bool altKey, bool shiftKey, bool metaKey, bool directionInvertedFromDevice);
 
     IntPoint m_wheelDelta;
     IntPoint m_rawDelta;
-    Granularity m_granularity;
+    DeltaMode m_deltaMode;
     bool m_directionInvertedFromDevice;
 };
 

Modified: trunk/Source/WebCore/page/EventHandler.cpp (141393 => 141394)


--- trunk/Source/WebCore/page/EventHandler.cpp	2013-01-31 10:52:41 UTC (rev 141393)
+++ trunk/Source/WebCore/page/EventHandler.cpp	2013-01-31 11:10:44 UTC (rev 141394)
@@ -251,14 +251,14 @@
 };
 #endif
 
-static inline ScrollGranularity wheelGranularityToScrollGranularity(WheelEvent::Granularity granularity)
+static inline ScrollGranularity wheelGranularityToScrollGranularity(WheelEvent::DeltaMode deltaMode)
 {
-    switch (granularity) {
-    case WheelEvent::Page:
+    switch (deltaMode) {
+    case WheelEvent::DOMDeltaPage:
         return ScrollByPage;
-    case WheelEvent::Line:
+    case WheelEvent::DOMDeltaLine:
         return ScrollByLine;
-    case WheelEvent::Pixel:
+    case WheelEvent::DOMDeltaPixel:
         return ScrollByPixel;
     }
     return ScrollByPixel;
@@ -2389,7 +2389,7 @@
         return;
     
     Node* stopNode = m_previousWheelScrolledNode.get();
-    ScrollGranularity granularity = wheelGranularityToScrollGranularity(wheelEvent->granularity());
+    ScrollGranularity granularity = wheelGranularityToScrollGranularity(wheelEvent->deltaMode());
     
     // Break up into two scrolls if we need to.  Diagonal movement on 
     // a MacBook pro is an example of a 2-dimensional mouse wheel event (where both deltaX and deltaY can be set).

Modified: trunk/Source/WebKit/chromium/ChangeLog (141393 => 141394)


--- trunk/Source/WebKit/chromium/ChangeLog	2013-01-31 10:52:41 UTC (rev 141393)
+++ trunk/Source/WebKit/chromium/ChangeLog	2013-01-31 11:10:44 UTC (rev 141394)
@@ -1,3 +1,21 @@
+2013-01-31  Kentaro Hara  <[email protected]>
+
+        Rename WheelEvent::Granularity to WheelEvent::DeltaMode
+        https://bugs.webkit.org/show_bug.cgi?id=108434
+
+        Reviewed by Ryosuke Niwa.
+
+        Per the spec, WheelEvent::Granularity should be renamed to WheelEvent::DeltaMode.
+
+        Spec: http://www.w3.org/TR/DOM-Level-3-Events/#events-WheelEvent
+        https://dvcs.w3.org/hg/d4e/raw-file/tip/source_respec.htm#constructor-wheelevent
+
+        No tests. No change in behavior.
+
+        * src/WebInputEventConversion.cpp:
+        (WebKit::PlatformWheelEventBuilder::PlatformWheelEventBuilder):
+        (WebKit::WebMouseWheelEventBuilder::WebMouseWheelEventBuilder):
+
 2013-01-31  Yury Semikhatsky  <[email protected]>
 
         Unreviewed. Bump Chromium dependency to 179332

Modified: trunk/Source/WebKit/chromium/src/WebInputEventConversion.cpp (141393 => 141394)


--- trunk/Source/WebKit/chromium/src/WebInputEventConversion.cpp	2013-01-31 10:52:41 UTC (rev 141393)
+++ trunk/Source/WebKit/chromium/src/WebInputEventConversion.cpp	2013-01-31 11:10:44 UTC (rev 141394)
@@ -517,7 +517,7 @@
     // The 120 is from WheelEvent::initWheelEvent().
     wheelTicksX = static_cast<float>(event.wheelDeltaX()) / 120;
     wheelTicksY = static_cast<float>(event.wheelDeltaY()) / 120;
-    scrollByPage = event.granularity() == WheelEvent::Page;
+    scrollByPage = event.deltaMode() == WheelEvent::DOMDeltaPage;
 }
 
 WebKeyboardEventBuilder::WebKeyboardEventBuilder(const KeyboardEvent& event)
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to