OLD | NEW |
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 Loading... |
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 while (!bestTouchNode->renderer()) { |
1271 while (bestTouchNode && !bestTouchNode->renderer()) | |
1272 bestTouchNode = NodeRenderingTraversal::parent(*bestTouchNode); | 1273 bestTouchNode = NodeRenderingTraversal::parent(*bestTouchNode); |
| 1274 if (!bestTouchNode) |
| 1275 return nullptr; |
| 1276 } |
| 1277 |
| 1278 // Editable nodes should not be highlighted (e.g., <input>) |
| 1279 if (bestTouchNode->hasEditableStyle()) |
| 1280 return nullptr; |
1273 | 1281 |
1274 Node* cursorDefiningAncestor = | 1282 Node* cursorDefiningAncestor = |
1275 findCursorDefiningAncestor(bestTouchNode, m_page->deprecatedLocalMainFra
me()); | 1283 findCursorDefiningAncestor(bestTouchNode, m_page->deprecatedLocalMainFra
me()); |
1276 // We show a highlight on tap only when the current node shows a hand cursor | 1284 // We show a highlight on tap only when the current node shows a hand cursor |
1277 if (!cursorDefiningAncestor || !showsHandCursor(cursorDefiningAncestor, m_pa
ge->deprecatedLocalMainFrame())) { | 1285 if (!cursorDefiningAncestor || !showsHandCursor(cursorDefiningAncestor, m_pa
ge->deprecatedLocalMainFrame())) { |
1278 return 0; | 1286 return 0; |
1279 } | 1287 } |
1280 | 1288 |
1281 // We should pick the largest enclosing node with hand cursor set. We do thi
s by first jumping | 1289 // 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 | 1290 // 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 Loading... |
4615 return mainFrameImpl()->frameView()->layoutSize().width() == m_size.width | 4623 return mainFrameImpl()->frameView()->layoutSize().width() == m_size.width |
4616 || (constraints.minimumScale == constraints.maximumScale && constraints.
minimumScale != -1); | 4624 || (constraints.minimumScale == constraints.maximumScale && constraints.
minimumScale != -1); |
4617 } | 4625 } |
4618 | 4626 |
4619 void WebViewImpl::forceNextWebGLContextCreationToFail() | 4627 void WebViewImpl::forceNextWebGLContextCreationToFail() |
4620 { | 4628 { |
4621 WebGLRenderingContext::forceNextWebGLContextCreationToFail(); | 4629 WebGLRenderingContext::forceNextWebGLContextCreationToFail(); |
4622 } | 4630 } |
4623 | 4631 |
4624 } // namespace blink | 4632 } // namespace blink |
OLD | NEW |