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

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

Issue 470833002: Add WebKit API for doing a hit-test that mimics GestureTap (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: tapCount Created 6 years, 1 month 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 | « Source/core/page/EventHandler.h ('k') | Source/web/WebViewImpl.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 22c1e6862a0a40e813a32c5323dbd4adea78492d..db67f9a4db424e721b543cb9f251a9b2f4207dfc 100644
--- a/Source/core/page/EventHandler.cpp
+++ b/Source/core/page/EventHandler.cpp
@@ -2583,6 +2583,24 @@ GestureEventWithHitTestResults EventHandler::targetGestureEvent(const PlatformGe
hitType |= HitTestRequest::ReadOnly;
}
+ GestureEventWithHitTestResults eventWithHitTestResults = hitTestResultForGestureEvent(gestureEvent, hitType);
+ // 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.
+ HitTestRequest request(hitType | HitTestRequest::AllowChildFrameContent);
+ if (!request.readOnly())
+ m_frame->document()->updateHoverActiveState(request, eventWithHitTestResults.hitTestResult().innerElement());
+
+ if (shouldKeepActiveForMinInterval) {
+ m_lastDeferredTapElement = eventWithHitTestResults.hitTestResult().innerElement();
+ m_activeIntervalTimer.startOneShot(minimumActiveInterval - activeInterval, FROM_HERE);
+ }
+
+ return eventWithHitTestResults;
+}
+
+GestureEventWithHitTestResults EventHandler::hitTestResultForGestureEvent(const PlatformGestureEvent& gestureEvent, HitTestRequest::HitTestRequestType hitType)
+{
// 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.
@@ -2614,18 +2632,6 @@ GestureEventWithHitTestResults EventHandler::targetGestureEvent(const PlatformGe
// 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.
- HitTestRequest request(hitType | HitTestRequest::AllowChildFrameContent);
- if (!request.readOnly())
- m_frame->document()->updateHoverActiveState(request, hitTestResult.innerElement());
-
- if (shouldKeepActiveForMinInterval) {
- m_lastDeferredTapElement = hitTestResult.innerElement();
- m_activeIntervalTimer.startOneShot(minimumActiveInterval - activeInterval, FROM_HERE);
- }
-
return GestureEventWithHitTestResults(adjustedEvent, hitTestResult);
}
« no previous file with comments | « Source/core/page/EventHandler.h ('k') | Source/web/WebViewImpl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698