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

Unified Diff: cc/trees/layer_tree_host_impl.cc

Issue 2759523002: Make sure all the touch events during an active fling are uncancelable (Closed)
Patch Set: fling layer Created 3 years, 9 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 | « cc/trees/layer_tree_host_impl.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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
« no previous file with comments | « cc/trees/layer_tree_host_impl.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698