Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(107)

Unified Diff: Source/WebCore/page/EventHandler.cpp

Issue 10988006: Merge 128999 - Do touch adjustment on GestureTapDown (Closed) Base URL: http://svn.webkit.org/repository/webkit/branches/chromium/1271/
Patch Set: Created 8 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: Source/WebCore/page/EventHandler.cpp
===================================================================
--- Source/WebCore/page/EventHandler.cpp (revision 129420)
+++ Source/WebCore/page/EventHandler.cpp (working copy)
@@ -2414,10 +2414,15 @@
if (gestureEvent.type() == PlatformEvent::GestureScrollEnd || gestureEvent.type() == PlatformEvent::GestureScrollUpdate)
eventTarget = m_scrollGestureHandlingNode.get();
+ IntPoint adjustedPoint = gestureEvent.position();
HitTestRequest::HitTestRequestType hitType = HitTestRequest::TouchEvent;
- if (gestureEvent.type() == PlatformEvent::GestureTapDown)
+ if (gestureEvent.type() == PlatformEvent::GestureTapDown) {
+#if ENABLE(TOUCH_ADJUSTMENT)
+ if (!gestureEvent.area().isEmpty())
+ adjustGesturePosition(gestureEvent, adjustedPoint);
+#endif
hitType |= HitTestRequest::Active;
- else if (gestureEvent.type() == PlatformEvent::GestureTap || gestureEvent.type() == PlatformEvent::GestureTapDownCancel)
+ } else if (gestureEvent.type() == PlatformEvent::GestureTap || gestureEvent.type() == PlatformEvent::GestureTapDownCancel)
hitType |= HitTestRequest::Release;
else
hitType |= HitTestRequest::Active | HitTestRequest::ReadOnly;
@@ -2426,7 +2431,7 @@
hitType |= HitTestRequest::ReadOnly;
if (!eventTarget || !(hitType & HitTestRequest::ReadOnly)) {
- IntPoint hitTestPoint = m_frame->view()->windowToContents(gestureEvent.position());
+ IntPoint hitTestPoint = m_frame->view()->windowToContents(adjustedPoint);
HitTestResult result = hitTestResultAtPoint(hitTestPoint, false, false, DontHitTestScrollbars, hitType);
eventTarget = result.targetNode();
}
@@ -2574,6 +2579,7 @@
Node* targetNode = 0;
switch (gestureEvent.type()) {
case PlatformEvent::GestureTap:
+ case PlatformEvent::GestureTapDown:
bestClickableNodeForTouchPoint(gestureEvent.position(), IntSize(gestureEvent.area().width() / 2, gestureEvent.area().height() / 2), adjustedPoint, targetNode);
break;
case PlatformEvent::GestureLongPress:
« no previous file with comments | « LayoutTests/touchadjustment/touch-links-active-expected.txt ('k') | Tools/DumpRenderTree/chromium/TestRunner/EventSender.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698