Changeset 171685 in webkit


Ignore:
Timestamp:
Jul 28, 2014 12:35:48 PM (10 years ago)
Author:
commit-queue@webkit.org
Message:

Let WheelEvent wrap a PlatformWheelEvent
https://bugs.webkit.org/show_bug.cgi?id=135244

WheelEvent now wraps a PlatformWheelEvent. m_directionInvertedFromDevice, as well as m_phase and m_momentumPhase
have been removed, since the information is redundant in PlatformWheelEvent. Note that deltaX and deltaY have
NOT been replaced, since we need double precision instead of float precision.

Patch by Wenson Hsieh <Wenson Hsieh> on 2014-07-28
Reviewed by Beth Dakin.

No new tests, since behavior should not have changed.

  • dom/WheelEvent.cpp:

(WebCore::WheelEvent::WheelEvent):
(WebCore::WheelEvent::initWheelEvent):

  • dom/WheelEvent.h:

(WebCore::WheelEvent::wheelEvent): Returns a non-null pointer to the PlatformWheelEvent iff WheelEvent was initialized by PlatformWheelEvent.
(WebCore::WheelEvent::webkitDirectionInvertedFromDevice): Updated to use PlatformWheelEvent.
(WebCore::WheelEvent::phase): Updated to use PlatformWheelEvent.
(WebCore::WheelEvent::momentumPhase): Updated to use PlatformWheelEvent.

Location:
trunk/Source/WebCore
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r171678 r171685  
     12014-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
    1232014-07-28  Brent Fulgham  <bfulgham@apple.com>
    224
  • trunk/Source/WebCore/dom/WheelEvent.cpp

    r171531 r171685  
    5151    , m_deltaZ(0)
    5252    , m_deltaMode(DOM_DELTA_PIXEL)
    53     , m_directionInvertedFromDevice(false)
     53    , m_initializedWithPlatformWheelEvent(false)
    5454{
    5555}
     
    6262    , m_deltaZ(initializer.deltaZ)
    6363    , m_deltaMode(initializer.deltaMode)
     64    , m_initializedWithPlatformWheelEvent(false)
    6465{
    6566}
     
    7677    , m_deltaZ(0)
    7778    , 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)
    8481{
    8582}
     
    104101
    105102    m_deltaMode = DOM_DELTA_PIXEL;
    106     m_directionInvertedFromDevice = false;
    107103
    108104    initCoordinates(IntPoint(pageX, pageY));
  • trunk/Source/WebCore/dom/WheelEvent.h

    r171531 r171685  
    7878        bool ctrlKey, bool altKey, bool shiftKey, bool metaKey);
    7979
    80     const PlatformWheelEvent* wheelEvent() const { return m_wheelEvent.get(); }
     80    const PlatformWheelEvent* wheelEvent() const { return m_initializedWithPlatformWheelEvent ? &m_wheelEvent : nullptr; }
    8181    double deltaX() const { return m_deltaX; } // Positive when scrolling right.
    8282    double deltaY() const { return m_deltaY; } // Positive when scrolling down.
     
    8787    unsigned deltaMode() const { return m_deltaMode; }
    8888
    89     bool webkitDirectionInvertedFromDevice() const { return m_directionInvertedFromDevice; }
     89    bool webkitDirectionInvertedFromDevice() const { return m_wheelEvent.directionInvertedFromDevice(); }
    9090    // Needed for Objective-C legacy support
    9191    bool isHorizontal() const { return m_wheelDelta.x(); }
     
    9595
    9696#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(); }
    9999#endif
    100100
     
    111111    double m_deltaZ;
    112112    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;
    120115};
    121116
Note: See TracChangeset for help on using the changeset viewer.