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

Unified Diff: Source/web/WebViewImpl.cpp

Issue 931753002: Disable gesture tap highlight on editable nodes (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: nit: removed obsolete comment Created 5 years, 10 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 | « LayoutTests/compositing/gestures/gesture-tapHighlight-form-input-text-expected.html ('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 9d314fb083d8c013b0979c995412fab2c297abae..deca8c20ba91eb6e109190fbf41d4b9f487d14cd 100644
--- a/Source/web/WebViewImpl.cpp
+++ b/Source/web/WebViewImpl.cpp
@@ -1264,12 +1264,20 @@ Node* WebViewImpl::bestTapNode(const GestureEventWithHitTestResults& targetedTap
return 0;
Node* bestTouchNode = targetedTapEvent.hitTestResult().innerNode();
+ if (!bestTouchNode)
+ return nullptr;
// We might hit something like an image map that has no renderer on it
// Walk up the tree until we have a node with an attached renderer
- // FIXME: This wants to walk composed tree with NodeRenderingTraversal::parent().
- while (bestTouchNode && !bestTouchNode->renderer())
+ while (!bestTouchNode->renderer()) {
bestTouchNode = NodeRenderingTraversal::parent(*bestTouchNode);
+ if (!bestTouchNode)
+ return nullptr;
+ }
+
+ // Editable nodes should not be highlighted (e.g., <input>)
+ if (bestTouchNode->hasEditableStyle())
+ return nullptr;
Node* cursorDefiningAncestor =
findCursorDefiningAncestor(bestTouchNode, m_page->deprecatedLocalMainFrame());
« no previous file with comments | « LayoutTests/compositing/gestures/gesture-tapHighlight-form-input-text-expected.html ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698