Changeset 115747 in webkit
- Timestamp:
- May 1, 2012 1:50:00 PM (12 years ago)
- Location:
- trunk/Source/WebCore
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r115746 r115747 1 2012-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 1 19 2012-05-01 Jessie Berlin <jberlin@apple.com> 2 20 -
trunk/Source/WebCore/page/EventHandler.cpp
r115242 r115747 2430 2430 } 2431 2431 2432 bool EventHandler::handleGestureTap(const PlatformGestureEvent& gestureEvent) 2433 { 2434 // FIXME: Refactor this code to not hit test multiple times. 2432 bool EventHandler::handleGestureTap(const PlatformGestureEvent& gestureEvent, Node* preTargetedNode) 2433 { 2435 2434 IntPoint adjustedPoint = gestureEvent.position(); 2436 2435 #if ENABLE(TOUCH_ADJUSTMENT) 2437 if (!gestureEvent.area().isEmpty() ) {2436 if (!gestureEvent.area().isEmpty() && !preTargetedNode) { 2438 2437 Node* targetNode = 0; 2439 2438 // For now we use the adjusted position to ensure the later redundant hit-tests hits the right node. … … 2443 2442 } 2444 2443 #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 2445 2448 bool defaultPrevented = false; 2446 2449 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 164 164 #if ENABLE(GESTURE_EVENTS) 165 165 bool handleGestureEvent(const PlatformGestureEvent&); 166 bool handleGestureTap(const PlatformGestureEvent& );166 bool handleGestureTap(const PlatformGestureEvent&, Node* preTargetedNode = 0); 167 167 bool handleGestureScrollUpdate(const PlatformGestureEvent&); 168 168 #endif
Note: See TracChangeset
for help on using the changeset viewer.