Chromium Code Reviews| 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 c9d453f11159dbf48755631fe0f21e7f4c3dc0c4..426239584f93af355dd99b3a7f8af62399bb13e2 100644 |
| --- a/cc/trees/layer_tree_host_common.cc |
| +++ b/cc/trees/layer_tree_host_common.cc |
| @@ -2377,34 +2377,20 @@ LayerImpl* LayerTreeHostCommon::FindLayerThatIsHitByPoint( |
| LayerImpl* LayerTreeHostCommon::FindLayerThatIsHitByPointInTouchHandlerRegion( |
| gfx::PointF screen_space_point, |
| const LayerImplList& render_surface_layer_list) { |
| - LayerImpl* found_layer = NULL; |
| - |
| - typedef LayerIterator<LayerImpl, |
| - LayerImplList, |
| - RenderSurfaceImpl, |
| - LayerIteratorActions::FrontToBack> LayerIteratorType; |
| - LayerIteratorType end = LayerIteratorType::End(&render_surface_layer_list); |
| - |
| - for (LayerIteratorType |
| - it = LayerIteratorType::Begin(&render_surface_layer_list); |
| - it != end; |
| - ++it) { |
| - // We don't want to consider render_surfaces for hit testing. |
| - if (!it.represents_itself()) |
| - continue; |
| - |
| - LayerImpl* current_layer = (*it); |
| - |
| - if (!LayerHasTouchEventHandlersAt(screen_space_point, current_layer)) |
| - continue; |
|
enne (OOO)
2013/10/18 19:18:38
I would have expected the fix here to be turning t
|
| - |
| - found_layer = current_layer; |
| - break; |
| + // First find out which layer was hit from the saved list of visible layers |
| + // in the most recent frame. |
| + LayerImpl* layer_impl = LayerTreeHostCommon::FindLayerThatIsHitByPoint( |
| + screen_space_point, |
| + render_surface_layer_list); |
| + |
| + // Walk up the hierarchy and look for a layer with a touch event handler |
|
enne (OOO)
2013/10/18 19:18:38
Can you help me understand why you need to walk up
sadrul
2013/10/18 19:57:44
Consider this example: http://jsfiddle.net/zcjJe/3
enne (OOO)
2013/10/21 19:52:04
I understand that you need to do *a* walk and not
sadrul
2013/10/21 21:36:46
I had to look at the history of the change to figu
|
| + // region that the given point hits. |
| + for (; layer_impl; layer_impl = layer_impl->parent()) { |
| + if (LayerTreeHostCommon::LayerHasTouchEventHandlersAt(screen_space_point, |
| + layer_impl)) |
| + break; |
| } |
| - |
| - // This can potentially return NULL, which means the screen_space_point did |
| - // not successfully hit test any layers, not even the root layer. |
| - return found_layer; |
| + return layer_impl; |
| } |
| bool LayerTreeHostCommon::LayerHasTouchEventHandlersAt( |