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

Unified Diff: cc/trees/layer_tree_host_common.cc

Issue 250663003: Relax touch hit testing in CC to look at all layers under a point (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Add unit test case Created 6 years, 8 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 | « no previous file | cc/trees/layer_tree_host_common_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/trees/layer_tree_host_common.cc
diff --git a/cc/trees/layer_tree_host_common.cc b/cc/trees/layer_tree_host_common.cc
index 99923d0a7c79ed7f079163206a03ff1f3a61d1e7..59e55edca903aea27473b58194db7321bf5d73d7 100644
--- a/cc/trees/layer_tree_host_common.cc
+++ b/cc/trees/layer_tree_host_common.cc
@@ -2526,12 +2526,6 @@ LayerImpl* LayerTreeHostCommon::FindLayerThatIsHitByPoint(
return found_layer;
}
-// This may be generalized in the future, but we know at the very least that
-// hits cannot pass through scrolling nor opaque layers.
-static bool OpaqueToHitTesting(const LayerImpl* layer) {
- return layer->scrollable() || layer->contents_opaque();
-}
-
LayerImpl* LayerTreeHostCommon::FindLayerThatIsHitByPointInTouchHandlerRegion(
const gfx::PointF& screen_space_point,
const LayerImplList& render_surface_layer_list) {
@@ -2553,8 +2547,12 @@ LayerImpl* LayerTreeHostCommon::FindLayerThatIsHitByPointInTouchHandlerRegion(
current_layer))
return current_layer;
- if (OpaqueToHitTesting(current_layer))
- break;
+ // Note that we could stop searching if we hit a layer we know to be
+ // opaque to hit-testing, but knowing that reliably is tricky (eg. due to
+ // CSS pointer-events: none). Also blink has an optimization for the
+ // common case of an entire document having handlers where it doesn't
+ // report any rects for child layers (since it knows they can't exceed
+ // the document bounds).
}
return NULL;
}
« no previous file with comments | « no previous file | cc/trees/layer_tree_host_common_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698