Changeset 141394 in webkit


Ignore:
Timestamp:
Jan 31, 2013 3:10:44 AM (11 years ago)
Author:
haraken@chromium.org
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):

Location:
trunk/Source
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r141393 r141394  
     12013-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
    1282013-01-30  Yury Semikhatsky  <yurys@chromium.org>
    229
  • trunk/Source/WebCore/dom/WheelEvent.cpp

    r141318 r141394  
    3939
    4040WheelEvent::WheelEvent()
    41     : m_granularity(Pixel)
     41    : m_deltaMode(DOMDeltaPixel)
    4242    , m_directionInvertedFromDevice(false)
    4343{
     
    5050}
    5151
    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)
     52WheelEvent::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)
    5755    : MouseEvent(eventNames().mousewheelEvent,
    5856                 true, true, view, 0, screenLocation.x(), screenLocation.y(),
     
    6462    , m_wheelDelta(IntPoint(static_cast<int>(wheelTicks.x() * TickMultiplier), static_cast<int>(wheelTicks.y() * TickMultiplier)))
    6563    , m_rawDelta(roundedIntPoint(rawDelta))
    66     , m_granularity(granularity)
     64    , m_deltaMode(deltaMode)
    6765    , m_directionInvertedFromDevice(directionInvertedFromDevice)
    6866{
     
    8886   
    8987    m_rawDelta = IntPoint(rawDeltaX, rawDeltaY);
    90     m_granularity = Pixel;
     88    m_deltaMode = DOMDeltaPixel;
    9189    m_directionInvertedFromDevice = false;
    9290
     
    112110}
    113111
    114 inline static WheelEvent::Granularity granularity(const PlatformWheelEvent& event)
     112inline static WheelEvent::DeltaMode deltaMode(const PlatformWheelEvent& event)
    115113{
    116     return event.granularity() == ScrollByPageWheelEvent ? WheelEvent::Page : WheelEvent::Pixel;
     114    return event.granularity() == ScrollByPageWheelEvent ? WheelEvent::DOMDeltaPage : WheelEvent::DOMDeltaPixel;
    117115}
    118116
     
    128126
    129127    setEvent(WheelEvent::create(FloatPoint(event.wheelTicksX(), event.wheelTicksY()), FloatPoint(event.deltaX(), event.deltaY()),
    130                                 granularity(event), view, event.globalPosition(), event.position(),
    131                                 event.ctrlKey(), event.altKey(), event.shiftKey(), event.metaKey(), event.directionInvertedFromDevice()));
     128        deltaMode(event), view, event.globalPosition(), event.position(),
     129        event.ctrlKey(), event.altKey(), event.shiftKey(), event.metaKey(), event.directionInvertedFromDevice()));
    132130}
    133131
  • trunk/Source/WebCore/dom/WheelEvent.h

    r141318 r141394  
    4242    enum { TickMultiplier = 120 };
    4343
    44     enum Granularity { Pixel, Line, Page };
     44    enum DeltaMode { DOMDeltaPixel, DOMDeltaLine, DOMDeltaPage };
    4545
    4646    static PassRefPtr<WheelEvent> create()
     
    5555
    5656    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,
    5858        const IntPoint& screenLocation, const IntPoint& pageLocation,
    5959        bool ctrlKey, bool altKey, bool shiftKey, bool metaKey, bool directionInvertedFromDevice)
    6060    {
    61         return adoptRef(new WheelEvent(wheelTicks, rawDelta, granularity, view,
     61        return adoptRef(new WheelEvent(wheelTicks, rawDelta, deltaMode, view,
    6262        screenLocation, pageLocation, ctrlKey, altKey, shiftKey, metaKey, directionInvertedFromDevice));
    6363    }
     
    7676    int rawDeltaX() const { return m_rawDelta.x(); }
    7777    int rawDeltaY() const { return m_rawDelta.y(); }
    78     Granularity granularity() const { return m_granularity; }
     78    DeltaMode deltaMode() const { return m_deltaMode; }
    7979
    8080    bool webkitDirectionInvertedFromDevice() const { return m_directionInvertedFromDevice; }
     
    8989    WheelEvent(const AtomicString&, const WheelEventInit&);
    9090    WheelEvent(const FloatPoint& wheelTicks, const FloatPoint& rawDelta,
    91         Granularity, PassRefPtr<AbstractView>,
     91        DeltaMode, PassRefPtr<AbstractView>,
    9292        const IntPoint& screenLocation, const IntPoint& pageLocation,
    9393        bool ctrlKey, bool altKey, bool shiftKey, bool metaKey, bool directionInvertedFromDevice);
     
    9595    IntPoint m_wheelDelta;
    9696    IntPoint m_rawDelta;
    97     Granularity m_granularity;
     97    DeltaMode m_deltaMode;
    9898    bool m_directionInvertedFromDevice;
    9999};
  • trunk/Source/WebCore/page/EventHandler.cpp

    r141088 r141394  
    252252#endif
    253253
    254 static inline ScrollGranularity wheelGranularityToScrollGranularity(WheelEvent::Granularity granularity)
    255 {
    256     switch (granularity) {
    257     case WheelEvent::Page:
     254static inline ScrollGranularity wheelGranularityToScrollGranularity(WheelEvent::DeltaMode deltaMode)
     255{
     256    switch (deltaMode) {
     257    case WheelEvent::DOMDeltaPage:
    258258        return ScrollByPage;
    259     case WheelEvent::Line:
     259    case WheelEvent::DOMDeltaLine:
    260260        return ScrollByLine;
    261     case WheelEvent::Pixel:
     261    case WheelEvent::DOMDeltaPixel:
    262262        return ScrollByPixel;
    263263    }
     
    23902390   
    23912391    Node* stopNode = m_previousWheelScrolledNode.get();
    2392     ScrollGranularity granularity = wheelGranularityToScrollGranularity(wheelEvent->granularity());
     2392    ScrollGranularity granularity = wheelGranularityToScrollGranularity(wheelEvent->deltaMode());
    23932393   
    23942394    // Break up into two scrolls if we need to.  Diagonal movement on
  • trunk/Source/WebKit/chromium/ChangeLog

    r141391 r141394  
     12013-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
    1192013-01-31  Yury Semikhatsky  <yurys@chromium.org>
    220
  • trunk/Source/WebKit/chromium/src/WebInputEventConversion.cpp

    r141346 r141394  
    518518    wheelTicksX = static_cast<float>(event.wheelDeltaX()) / 120;
    519519    wheelTicksY = static_cast<float>(event.wheelDeltaY()) / 120;
    520     scrollByPage = event.granularity() == WheelEvent::Page;
     520    scrollByPage = event.deltaMode() == WheelEvent::DOMDeltaPage;
    521521}
    522522
Note: See TracChangeset for help on using the changeset viewer.