Chromium Code Reviews| Index: cc/trees/layer_tree_host_impl.cc |
| diff --git a/cc/trees/layer_tree_host_impl.cc b/cc/trees/layer_tree_host_impl.cc |
| index c7238e8b010676ff9bfebaeb3ac0e2ec7de27982..5cc26db7e920b238200586bef727065e05277232 100644 |
| --- a/cc/trees/layer_tree_host_impl.cc |
| +++ b/cc/trees/layer_tree_host_impl.cc |
| @@ -598,13 +598,12 @@ EventListenerProperties LayerTreeHostImpl::GetEventListenerProperties( |
| // Return true if scrollable node for 'ancestor' is the same as 'child' or an |
| // ancestor along the scroll tree. |
| -bool IsScrolledBy(LayerImpl* child, ScrollNode* ancestor) { |
| +bool LayerTreeHostImpl::IsScrolledBy(LayerImpl* child, ScrollNode* ancestor) { |
| DCHECK(ancestor && ancestor->scrollable); |
| if (!child) |
| return false; |
| - auto* property_trees = child->layer_tree_impl()->property_trees(); |
| - ScrollTree& scroll_tree = property_trees->scroll_tree; |
| + ScrollTree& scroll_tree = active_tree_->property_trees()->scroll_tree; |
|
tdresser
2017/03/20 20:15:45
I don't understand this change. In what context is
lanwei
2017/03/22 17:34:29
It is the same. I just feel it is better to use ac
|
| for (ScrollNode* scroll_node = scroll_tree.Node(child->scroll_tree_index()); |
| scroll_node; scroll_node = scroll_tree.parent(scroll_node)) { |
| if (scroll_node->id == ancestor->id) |
| @@ -621,15 +620,19 @@ LayerTreeHostImpl::EventListenerTypeForTouchStartAt( |
| // Now determine if there are actually any handlers at that point. |
| // TODO(rbyers): Consider also honoring touch-action (crbug.com/347272). |
| - LayerImpl* layer_impl = |
| + LayerImpl* layer_impl_touch_handler = |
| active_tree_->FindLayerThatIsHitByPointInTouchHandlerRegion( |
| device_viewport_point); |
| - if (layer_impl == NULL) |
| + if (layer_impl_touch_handler == NULL) |
| return InputHandler::TouchStartEventListenerType::NO_HANDLER; |
| if (!CurrentlyScrollingNode()) |
| return InputHandler::TouchStartEventListenerType::HANDLER; |
| + // Check if the touch start hits on the current scrolling layer or its |
| + // descendant. |
|
tdresser
2017/03/20 20:15:45
Add a comment describing why we can't use the laye
|
| + LayerImpl* layer_impl = |
| + active_tree_->FindLayerThatIsHitByPoint(device_viewport_point); |
| bool is_ancestor = IsScrolledBy(layer_impl, CurrentlyScrollingNode()); |
| return is_ancestor ? InputHandler::TouchStartEventListenerType:: |
| HANDLER_ON_SCROLLING_LAYER |