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

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

Issue 512983005: Cleanup some touch adjustment FIXMEs (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Merge with trunk Created 6 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
« no previous file with comments | « no previous file | Source/core/rendering/HitTestResult.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/page/EventHandler.cpp
diff --git a/Source/core/page/EventHandler.cpp b/Source/core/page/EventHandler.cpp
index 8aa13a37349ccc9df8cfd1a77e280f12a1f8f469..b4bfa6534e4dde186675a47dd3c7dcdcbdf1f32a 100644
--- a/Source/core/page/EventHandler.cpp
+++ b/Source/core/page/EventHandler.cpp
@@ -2576,14 +2576,16 @@ GestureEventWithHitTestResults EventHandler::targetGestureEvent(const PlatformGe
hitType |= HitTestRequest::ReadOnly;
}
- // Perform the rect-based hit-test. Note that we don't yet apply hover/active state here
- // because we need to resolve touch adjustment first so that we apply hover/active it to
- // the final adjusted node.
+ // Perform the rect-based hit-test (or point-based if adjustment is disabled). Note that
+ // we don't yet apply hover/active state here because we need to resolve touch adjustment
+ // first so that we apply hover/active it to the final adjusted node.
IntPoint hitTestPoint = m_frame->view()->windowToContents(gestureEvent.position());
- IntSize touchRadius = gestureEvent.area();
- touchRadius.scale(1.f / 2);
- // FIXME: We should not do a rect-based hit-test if touch adjustment is disabled.
- HitTestResult hitTestResult = hitTestResultAtPoint(hitTestPoint, hitType | HitTestRequest::ReadOnly, touchRadius);
+ LayoutSize padding;
+ if (shouldApplyTouchAdjustment(gestureEvent)) {
+ padding = gestureEvent.area();
+ padding.scale(1.f / 2);
+ }
+ HitTestResult hitTestResult = hitTestResultAtPoint(hitTestPoint, hitType | HitTestRequest::ReadOnly, padding);
// Hit-test the main frame scrollbars (in addition to the child-frame and RenderLayer
// scroll bars checked by the hit-test code.
@@ -2615,6 +2617,10 @@ GestureEventWithHitTestResults EventHandler::targetGestureEvent(const PlatformGe
}
}
+ // If we did a rect-based hit test it must be resolved to the best single node by now to
+ // ensure consumers don't accidentally use one of the other candidates.
+ ASSERT(!hitTestResult.isRectBasedTest());
+
// Now apply hover/active state to the final target.
// FIXME: This is supposed to send mouseenter/mouseleave events, but doesn't because we
// aren't passing a PlatformMouseEvent.
« no previous file with comments | « no previous file | Source/core/rendering/HitTestResult.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698