Changeset 88307 in webkit


Ignore:
Timestamp:
Jun 7, 2011 6:18:43 PM (13 years ago)
Author:
commit-queue@webkit.org
Message:

2011-06-07 Robert Kroeger <rjkroege@chromium.org>

Reviewed by Adam Barth.

[chromium] Add a basic gesture recognizer to the Chromium platform
https://bugs.webkit.org/show_bug.cgi?id=54417

Shows that the basic Chromium gesture manager can correctly convert a touch
event sequence into a sequence of synthetic mouse events for clicking and
scrolling.

  • fast/events/touch/touch-gesture-click-expected.txt: Added.
  • fast/events/touch/touch-gesture-click.html: Added.
  • fast/events/touch/touch-gesture-scroll-expected.txt: Added.
  • fast/events/touch/touch-gesture-scroll.html: Added.
  • platform/chromium/fast/events/touch/touch-gesture-click-expected.txt: Added.
  • platform/chromium/fast/events/touch/touch-gesture-scroll-expected.txt: Added.

2011-06-07 Robert Kroeger <rjkroege@chromium.org>

Reviewed by Adam Barth.

[chromium] Add a basic gesture recognizer to the Chromium platform
https://bugs.webkit.org/show_bug.cgi?id=54417

Adds a basic gesture recognizer to the Chromium platform. Adds an entry
point to the GestureRecognizer to reset any internal state on a page reset.
Resetting the gesture recognizer on page load is necesary for reliable
layout test execution and improves gesture recognizer operational
robustness.

Added an additional constructor to permit building a synthetic
PlatformWheelEvent.

Small modifications to the PlatformGestureRecognizer as required to
implement the simple Chromium platform gesture recognizer.

Tests: fast/events/touch/touch-gesture-click.html

  • WebCore.gypi:
  • page/EventHandler.cpp: (WebCore::EventHandler::resetGestureRecognizer):
  • page/EventHandler.h:
  • page/FrameView.cpp: (WebCore::FrameView::reset):
  • platform/PlatformGestureRecognizer.h:
  • platform/PlatformWheelEvent.h: (WebCore::PlatformWheelEvent::PlatformWheelEvent):
  • platform/chromium/GestureRecognizerChromium.cpp: Added. (WebCore::InnerGestureRecognizer::InnerGestureRecognizer): (WebCore::InnerGestureRecognizer::reset): (WebCore::InnerGestureRecognizer::~InnerGestureRecognizer): (WebCore::InnerGestureRecognizer::addEdgeFunction): (WebCore::InnerGestureRecognizer::isInClickTimeWindow): (WebCore::InnerGestureRecognizer::isInsideManhattanSquare): (WebCore::InnerGestureRecognizer::dispatchSyntheticClick): (WebCore::InnerGestureRecognizer::processTouchEventForGesture): (WebCore::InnerGestureRecognizer::scrollViaTouchMotion): (WebCore::InnerGestureRecognizer::updateValues): (WebCore::InnerGestureRecognizer::signature): (WebCore::touchDown): (WebCore::noGesture): (WebCore::click): (WebCore::isClickOrScroll): (WebCore::inScroll): (WebCore::PlatformGestureRecognizer::create): (WebCore::PlatformGestureRecognizer::PlatformGestureRecognizer): (WebCore::PlatformGestureRecognizer::~PlatformGestureRecognizer): (WebCore::GestureRecognizerChromium::GestureRecognizerChromium): (WebCore::GestureRecognizerChromium::~GestureRecognizerChromium):
  • platform/chromium/GestureRecognizerChromium.h: Added. (WebCore::InnerGestureRecognizer::setState): (WebCore::InnerGestureRecognizer::state): (WebCore::GestureRecognizerChromium::reset): (WebCore::GestureRecognizerChromium::processTouchEventForGesture):

2011-06-07 Robert Kroeger <rjkroege@chromium.org>

Reviewed by Adam Barth.

[chromium] Add a basic gesture recognizer to the Chromium platform
https://bugs.webkit.org/show_bug.cgi?id=54417

Added unit tests for the basic chromium platform gesture recognizer.

  • tests/InnerGestureRecognizerTest.cpp: Added. (WebCore::InspectableInnerGestureRecognizer::InspectableInnerGestureRecognizer): (WebCore::InspectableInnerGestureRecognizer::signature): (WebCore::InspectableInnerGestureRecognizer::firstTouchPosition): (WebCore::InspectableInnerGestureRecognizer::setFirstTouchTime): (WebCore::InspectableInnerGestureRecognizer::firstTouchTime): (WebCore::InspectableInnerGestureRecognizer::setLastTouchTime): (WebCore::InspectableInnerGestureRecognizer::lastTouchTime): (WebCore::InspectableInnerGestureRecognizer::edgeFunction): (WebCore::InspectableInnerGestureRecognizer::updateValues): (WebCore::InspectableInnerGestureRecognizer::addEdgeFunction): (WebCore::BuildablePlatformTouchPoint::setX): (WebCore::BuildablePlatformTouchPoint::setY): (WebCore::BuildablePlatformTouchPoint::BuildablePlatformTouchPoint): (WebCore::TestGestureRecognizer::TestGestureRecognizer): (WebCore::TestGestureRecognizer::SetUp): (WebCore::TestGestureRecognizer::TearDown): (WebCore::TEST_F):
Location:
trunk
Files:
10 added
10 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r88306 r88307  
     12011-06-07  Robert Kroeger  <rjkroege@chromium.org>
     2
     3        Reviewed by Adam Barth.
     4
     5        [chromium] Add a basic gesture recognizer to the Chromium platform
     6        https://bugs.webkit.org/show_bug.cgi?id=54417
     7
     8        Shows that the basic Chromium gesture manager can correctly convert a touch
     9        event sequence into a sequence of synthetic mouse events for clicking and
     10        scrolling.
     11
     12        * fast/events/touch/touch-gesture-click-expected.txt: Added.
     13        * fast/events/touch/touch-gesture-click.html: Added.
     14        * fast/events/touch/touch-gesture-scroll-expected.txt: Added.
     15        * fast/events/touch/touch-gesture-scroll.html: Added.
     16        * platform/chromium/fast/events/touch/touch-gesture-click-expected.txt: Added.
     17        * platform/chromium/fast/events/touch/touch-gesture-scroll-expected.txt: Added.
     18
    1192011-06-07  James Kozianski  <koz@chromium.org>
    220
  • trunk/Source/WebCore/ChangeLog

    r88304 r88307  
     12011-06-07  Robert Kroeger  <rjkroege@chromium.org>
     2
     3        Reviewed by Adam Barth.
     4
     5        [chromium] Add a basic gesture recognizer to the Chromium platform
     6        https://bugs.webkit.org/show_bug.cgi?id=54417
     7
     8        Adds a basic gesture recognizer to the Chromium platform. Adds an entry
     9        point to the GestureRecognizer to reset any internal state on a page reset.
     10        Resetting the gesture recognizer on page load is necesary for reliable
     11        layout test execution and improves gesture recognizer operational
     12        robustness.
     13
     14        Added an additional constructor to permit building a synthetic
     15        PlatformWheelEvent.
     16
     17        Small modifications to the PlatformGestureRecognizer as required to
     18        implement the simple Chromium platform gesture recognizer.
     19
     20        Tests: fast/events/touch/touch-gesture-click.html
     21
     22        * WebCore.gypi:
     23        * page/EventHandler.cpp:
     24        (WebCore::EventHandler::resetGestureRecognizer):
     25        * page/EventHandler.h:
     26        * page/FrameView.cpp:
     27        (WebCore::FrameView::reset):
     28        * platform/PlatformGestureRecognizer.h:
     29        * platform/PlatformWheelEvent.h:
     30        (WebCore::PlatformWheelEvent::PlatformWheelEvent):
     31        * platform/chromium/GestureRecognizerChromium.cpp: Added.
     32        (WebCore::InnerGestureRecognizer::InnerGestureRecognizer):
     33        (WebCore::InnerGestureRecognizer::reset):
     34        (WebCore::InnerGestureRecognizer::~InnerGestureRecognizer):
     35        (WebCore::InnerGestureRecognizer::addEdgeFunction):
     36        (WebCore::InnerGestureRecognizer::isInClickTimeWindow):
     37        (WebCore::InnerGestureRecognizer::isInsideManhattanSquare):
     38        (WebCore::InnerGestureRecognizer::dispatchSyntheticClick):
     39        (WebCore::InnerGestureRecognizer::processTouchEventForGesture):
     40        (WebCore::InnerGestureRecognizer::scrollViaTouchMotion):
     41        (WebCore::InnerGestureRecognizer::updateValues):
     42        (WebCore::InnerGestureRecognizer::signature):
     43        (WebCore::touchDown):
     44        (WebCore::noGesture):
     45        (WebCore::click):
     46        (WebCore::isClickOrScroll):
     47        (WebCore::inScroll):
     48        (WebCore::PlatformGestureRecognizer::create):
     49        (WebCore::PlatformGestureRecognizer::PlatformGestureRecognizer):
     50        (WebCore::PlatformGestureRecognizer::~PlatformGestureRecognizer):
     51        (WebCore::GestureRecognizerChromium::GestureRecognizerChromium):
     52        (WebCore::GestureRecognizerChromium::~GestureRecognizerChromium):
     53        * platform/chromium/GestureRecognizerChromium.h: Added.
     54        (WebCore::InnerGestureRecognizer::setState):
     55        (WebCore::InnerGestureRecognizer::state):
     56        (WebCore::GestureRecognizerChromium::reset):
     57        (WebCore::GestureRecognizerChromium::processTouchEventForGesture):
     58
    1592011-06-07  No'am Rosenthal  <noam.rosenthal@nokia.com>
    260
  • trunk/Source/WebCore/WebCore.gypi

    r88286 r88307  
    768768            'platform/NotImplemented.h',
    769769            'platform/PlatformGestureEvent.h',
    770             'platform/PlatformGestureRecognizer.cpp',
    771770            'platform/PlatformGestureRecognizer.h',
    772771            'platform/PlatformKeyboardEvent.h',
     
    38143813            'platform/chromium/FramelessScrollView.h',
    38153814            'platform/chromium/FramelessScrollViewClient.h',
     3815            'platform/chromium/GestureRecognizerChromium.cpp',
     3816            'platform/chromium/GestureRecognizerChromium.h',
    38163817            'platform/chromium/KeyCodeConversion.h',
    38173818            'platform/chromium/KeyCodeConversionGtk.cpp',
  • trunk/Source/WebCore/page/EventHandler.cpp

    r88178 r88307  
    32933293    return defaultPrevented;
    32943294}
    3295 #endif
    3296 
    3297 }
     3295
     3296#if ENABLE(GESTURE_RECOGNIZER)
     3297void EventHandler::resetGestureRecognizer()
     3298{
     3299    if (m_gestureRecognizer)
     3300        m_gestureRecognizer->reset();
     3301}
     3302#endif
     3303
     3304
     3305#endif
     3306
     3307}
  • trunk/Source/WebCore/page/EventHandler.h

    r87951 r88307  
    167167#endif
    168168
     169#if ENABLE(GESTURE_RECOGNIZER)
     170    void resetGestureRecognizer();
     171#endif
     172
    169173#if ENABLE(CONTEXT_MENUS)
    170174    bool sendContextMenuEvent(const PlatformMouseEvent&);
  • trunk/Source/WebCore/page/FrameView.cpp

    r88284 r88307  
    236236    m_firstVisuallyNonEmptyLayoutCallbackPending = true;
    237237    m_maintainScrollPositionAnchor = 0;
     238
     239#if ENABLE(GESTURE_RECOGNIZER)
     240    frame()->eventHandler()->resetGestureRecognizer();
     241#endif
    238242}
    239243
  • trunk/Source/WebCore/platform/PlatformGestureRecognizer.h

    r84890 r88307  
    5858    // Returns true if the event resulted in firing a synthetic event.
    5959    virtual bool processTouchEventForGesture(const PlatformTouchEvent&, EventHandler*, bool handled) = 0;
     60
     61    // Clears the GestureRecognizer to its initial state.
     62    virtual void reset() = 0;
    6063};
    6164
  • trunk/Source/WebCore/platform/PlatformWheelEvent.h

    r79141 r88307  
    107107        }
    108108
     109        PlatformWheelEvent(IntPoint position, IntPoint globalPosition, float deltaX, float deltaY, float wheelTicksX, float wheelTicksY, PlatformWheelEventGranularity granularity, bool isAccepted, bool shiftKey, bool ctrlKey, bool altKey, bool metaKey)
     110            : m_position(position)
     111            , m_globalPosition(globalPosition)
     112            , m_deltaX(deltaX)
     113            , m_deltaY(deltaY)
     114            , m_wheelTicksX(wheelTicksX)
     115            , m_wheelTicksY(wheelTicksY)
     116            , m_granularity(granularity)
     117            , m_isAccepted(isAccepted)
     118            , m_shiftKey(shiftKey)
     119            , m_ctrlKey(ctrlKey)
     120            , m_altKey(altKey)
     121            , m_metaKey(metaKey)
     122#if PLATFORM(MAC)
     123            , m_hasPreciseScrollingDeltas(false)
     124            , m_phase(PlatformWheelEventPhaseNone)
     125            , m_momentumPhase(PlatformWheelEventPhaseNone)
     126            , m_timestamp(0)
     127#endif
     128        {
     129        }
     130
    109131        const IntPoint& pos() const { return m_position; } // PlatformWindow coordinates.
    110132        const IntPoint& globalPos() const { return m_globalPosition; } // Screen coordinates.
  • trunk/Source/WebKit/chromium/ChangeLog

    r88288 r88307  
     12011-06-07  Robert Kroeger  <rjkroege@chromium.org>
     2
     3        Reviewed by Adam Barth.
     4
     5        [chromium] Add a basic gesture recognizer to the Chromium platform
     6        https://bugs.webkit.org/show_bug.cgi?id=54417
     7
     8        Added unit tests for the basic chromium platform gesture recognizer.
     9
     10        * tests/InnerGestureRecognizerTest.cpp: Added.
     11        (WebCore::InspectableInnerGestureRecognizer::InspectableInnerGestureRecognizer):
     12        (WebCore::InspectableInnerGestureRecognizer::signature):
     13        (WebCore::InspectableInnerGestureRecognizer::firstTouchPosition):
     14        (WebCore::InspectableInnerGestureRecognizer::setFirstTouchTime):
     15        (WebCore::InspectableInnerGestureRecognizer::firstTouchTime):
     16        (WebCore::InspectableInnerGestureRecognizer::setLastTouchTime):
     17        (WebCore::InspectableInnerGestureRecognizer::lastTouchTime):
     18        (WebCore::InspectableInnerGestureRecognizer::edgeFunction):
     19        (WebCore::InspectableInnerGestureRecognizer::updateValues):
     20        (WebCore::InspectableInnerGestureRecognizer::addEdgeFunction):
     21        (WebCore::BuildablePlatformTouchPoint::setX):
     22        (WebCore::BuildablePlatformTouchPoint::setY):
     23        (WebCore::BuildablePlatformTouchPoint::BuildablePlatformTouchPoint):
     24        (WebCore::TestGestureRecognizer::TestGestureRecognizer):
     25        (WebCore::TestGestureRecognizer::SetUp):
     26        (WebCore::TestGestureRecognizer::TearDown):
     27        (WebCore::TEST_F):
     28
    1292011-06-07  Vangelis Kokkevis  <vangelis@chromium.org>
    230
  • trunk/Source/WebKit/chromium/WebKit.gypi

    r87089 r88307  
    5454        'webkit_unittest_files': [
    5555            'tests/ArenaTestHelpers.h',
     56            'tests/InnerGestureRecognizerTest.cpp',
    5657            'tests/CCThreadTaskTest.cpp',
    5758            'tests/CCThreadTest.cpp',
Note: See TracChangeset for help on using the changeset viewer.