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

Unified Diff: Source/web/WebViewImpl.cpp

Issue 604573002: Eliminate hit test for content detection on GestureTap. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Update hit test counts 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 | « Source/web/WebViewImpl.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/web/WebViewImpl.cpp
diff --git a/Source/web/WebViewImpl.cpp b/Source/web/WebViewImpl.cpp
index 3cc40830398ad515275708a40db35074d99bef98..fac74863b8f054e70b530ab02078e21e5fdfa08c 100644
--- a/Source/web/WebViewImpl.cpp
+++ b/Source/web/WebViewImpl.cpp
@@ -733,9 +733,7 @@ bool WebViewImpl::handleGestureEvent(const WebGestureEvent& event)
switch (event.type) {
case WebInputEvent::GestureTap: {
m_client->cancelScheduledContentIntents();
- // FIXME: Use targeted event here and save another hit test.
- // FIXME: Content intent should be generated using same node that was highlighted. crbug.com/416746
- if (detectContentOnTouch(platformEvent.position())) {
+ if (detectContentOnTouch(targetedEvent)) {
eventSwallowed = true;
break;
}
@@ -4292,9 +4290,14 @@ void WebViewImpl::updateRootLayerTransform()
}
}
-bool WebViewImpl::detectContentOnTouch(const WebPoint& position)
+bool WebViewImpl::detectContentOnTouch(const GestureEventWithHitTestResults& targetedEvent)
{
- HitTestResult touchHit = hitTestResultForWindowPos(position);
+ if (!m_page->mainFrame()->isLocalFrame())
+ return false;
+
+ // Need a local copy of the hit test as setToShadowHostIfInUserAgentShadowRoot() will modify it.
+ HitTestResult touchHit = targetedEvent.hitTestResult();
+ touchHit.setToShadowHostIfInUserAgentShadowRoot();
if (touchHit.isContentEditable())
return false;
« no previous file with comments | « Source/web/WebViewImpl.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698