Changeset 115747 in webkit


Ignore:
Timestamp:
May 1, 2012 1:50:00 PM (12 years ago)
Author:
commit-queue@webkit.org
Message:

Allow a pre-targeted node to be specified when dispatching a GestureTap event
https://bugs.webkit.org/show_bug.cgi?id=85296

Patch by Terry Anderson <tdanderson@chromium.org> on 2012-05-01
Reviewed by Adam Barth.

https://bugs.webkit.org/show_bug.cgi?id=85101

The new parameter will be used and tested in this patch.

  • page/EventHandler.cpp:

(WebCore::EventHandler::handleGestureTap):

The new preTargetedNode parameter can be used to pass in the Node that is
the target of the GestureTap event. If this parameter is used, adjustedPoint
is changed to be the center of the Node's bounding rectangle.

  • page/EventHandler.h:

(EventHandler):

Location:
trunk/Source/WebCore
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r115746 r115747  
     12012-05-01  Terry Anderson  <tdanderson@chromium.org>
     2
     3        Allow a pre-targeted node to be specified when dispatching a GestureTap event
     4        https://bugs.webkit.org/show_bug.cgi?id=85296
     5
     6        Reviewed by Adam Barth.
     7
     8        https://bugs.webkit.org/show_bug.cgi?id=85101
     9            The new parameter will be used and tested in this patch.
     10
     11        * page/EventHandler.cpp:
     12        (WebCore::EventHandler::handleGestureTap):
     13            The new preTargetedNode parameter can be used to pass in the Node that is
     14            the target of the GestureTap event. If this parameter is used, adjustedPoint
     15            is changed to be the center of the Node's bounding rectangle.
     16        * page/EventHandler.h:
     17        (EventHandler):
     18
    1192012-05-01  Jessie Berlin  <jberlin@apple.com>
    220
  • trunk/Source/WebCore/page/EventHandler.cpp

    r115242 r115747  
    24302430}
    24312431
    2432 bool EventHandler::handleGestureTap(const PlatformGestureEvent& gestureEvent)
    2433 {
    2434     // FIXME: Refactor this code to not hit test multiple times.
     2432bool EventHandler::handleGestureTap(const PlatformGestureEvent& gestureEvent, Node* preTargetedNode)
     2433{
    24352434    IntPoint adjustedPoint = gestureEvent.position();
    24362435#if ENABLE(TOUCH_ADJUSTMENT)
    2437     if (!gestureEvent.area().isEmpty()) {
     2436    if (!gestureEvent.area().isEmpty() && !preTargetedNode) {
    24382437        Node* targetNode = 0;
    24392438        // For now we use the adjusted position to ensure the later redundant hit-tests hits the right node.
     
    24432442    }
    24442443#endif
     2444    // FIXME: Refactor to avoid hit testing multiple times (this is only an interim step).
     2445    if (preTargetedNode)
     2446        adjustedPoint = preTargetedNode->getRect().center();
     2447
    24452448    bool defaultPrevented = false;
    24462449    PlatformMouseEvent fakeMouseMove(adjustedPoint, gestureEvent.globalPosition(), NoButton, PlatformEvent::MouseMoved, /* clickCount */ 1, gestureEvent.shiftKey(), gestureEvent.ctrlKey(), gestureEvent.altKey(), gestureEvent.metaKey(), gestureEvent.timestamp());
  • trunk/Source/WebCore/page/EventHandler.h

    r113962 r115747  
    164164#if ENABLE(GESTURE_EVENTS)
    165165    bool handleGestureEvent(const PlatformGestureEvent&);
    166     bool handleGestureTap(const PlatformGestureEvent&);
     166    bool handleGestureTap(const PlatformGestureEvent&, Node* preTargetedNode = 0);
    167167    bool handleGestureScrollUpdate(const PlatformGestureEvent&);
    168168#endif
Note: See TracChangeset for help on using the changeset viewer.