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

Side by Side 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: 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 unified diff | 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 »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2011, 2012 Google Inc. All rights reserved. 2 * Copyright (C) 2011, 2012 Google Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions are 5 * modification, are permitted provided that the following conditions are
6 * met: 6 * met:
7 * 7 *
8 * * Redistributions of source code must retain the above copyright 8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * * Redistributions in binary form must reproduce the above 10 * * Redistributions in binary form must reproduce the above
(...skipping 1246 matching lines...) Expand 10 before | Expand all | Expand 10 after
1257 } 1257 }
1258 1258
1259 Node* WebViewImpl::bestTapNode(const GestureEventWithHitTestResults& targetedTap Event) 1259 Node* WebViewImpl::bestTapNode(const GestureEventWithHitTestResults& targetedTap Event)
1260 { 1260 {
1261 TRACE_EVENT0("input", "WebViewImpl::bestTapNode"); 1261 TRACE_EVENT0("input", "WebViewImpl::bestTapNode");
1262 1262
1263 if (!m_page || !m_page->mainFrame()) 1263 if (!m_page || !m_page->mainFrame())
1264 return 0; 1264 return 0;
1265 1265
1266 Node* bestTouchNode = targetedTapEvent.hitTestResult().innerNode(); 1266 Node* bestTouchNode = targetedTapEvent.hitTestResult().innerNode();
1267 if (!bestTouchNode)
1268 return nullptr;
1267 1269
1268 // We might hit something like an image map that has no renderer on it 1270 // We might hit something like an image map that has no renderer on it
1269 // Walk up the tree until we have a node with an attached renderer 1271 // Walk up the tree until we have a node with an attached renderer
1270 // FIXME: This wants to walk composed tree with NodeRenderingTraversal::pare nt(). 1272 // FIXME: This wants to walk composed tree with NodeRenderingTraversal::pare nt().
Rick Byers 2015/02/20 20:37:14 nit: mind removing this FIXME while you're here?
kojii 2015/02/23 03:44:18 Done.
1271 while (bestTouchNode && !bestTouchNode->renderer()) 1273 while (!bestTouchNode->renderer()) {
1272 bestTouchNode = NodeRenderingTraversal::parent(*bestTouchNode); 1274 bestTouchNode = NodeRenderingTraversal::parent(*bestTouchNode);
1275 if (!bestTouchNode)
1276 return nullptr;
1277 }
1278
1279 // Editable nodes should not be highlighted (e.g., <input>)
hayato 2015/02/17 10:34:56 Not sure this is always true. I'm afraid that this
kojii 2015/02/17 13:08:02 Highlights are for links, so I suppose it's quite
Rick Byers 2015/02/20 20:37:14 Highlights are for more than "links", eg. a <div>
1280 if (bestTouchNode->hasEditableStyle())
1281 return nullptr;
1273 1282
1274 Node* cursorDefiningAncestor = 1283 Node* cursorDefiningAncestor =
1275 findCursorDefiningAncestor(bestTouchNode, m_page->deprecatedLocalMainFra me()); 1284 findCursorDefiningAncestor(bestTouchNode, m_page->deprecatedLocalMainFra me());
1276 // We show a highlight on tap only when the current node shows a hand cursor 1285 // We show a highlight on tap only when the current node shows a hand cursor
1277 if (!cursorDefiningAncestor || !showsHandCursor(cursorDefiningAncestor, m_pa ge->deprecatedLocalMainFrame())) { 1286 if (!cursorDefiningAncestor || !showsHandCursor(cursorDefiningAncestor, m_pa ge->deprecatedLocalMainFrame())) {
1278 return 0; 1287 return 0;
1279 } 1288 }
1280 1289
1281 // We should pick the largest enclosing node with hand cursor set. We do thi s by first jumping 1290 // We should pick the largest enclosing node with hand cursor set. We do thi s by first jumping
1282 // up to cursorDefiningAncestor (which is already known to have hand cursor set). Then we locate 1291 // up to cursorDefiningAncestor (which is already known to have hand cursor set). Then we locate
(...skipping 3332 matching lines...) Expand 10 before | Expand all | Expand 10 after
4615 return mainFrameImpl()->frameView()->layoutSize().width() == m_size.width 4624 return mainFrameImpl()->frameView()->layoutSize().width() == m_size.width
4616 || (constraints.minimumScale == constraints.maximumScale && constraints. minimumScale != -1); 4625 || (constraints.minimumScale == constraints.maximumScale && constraints. minimumScale != -1);
4617 } 4626 }
4618 4627
4619 void WebViewImpl::forceNextWebGLContextCreationToFail() 4628 void WebViewImpl::forceNextWebGLContextCreationToFail()
4620 { 4629 {
4621 WebGLRenderingContext::forceNextWebGLContextCreationToFail(); 4630 WebGLRenderingContext::forceNextWebGLContextCreationToFail();
4622 } 4631 }
4623 4632
4624 } // namespace blink 4633 } // namespace blink
OLDNEW
« 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