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

Unified Diff: cc/trees/layer_tree_host_impl.cc

Issue 2769793002: Implement CSS: scroll-boundary-behavior (Closed)
Patch Set: Update WebScrollBoundaryBehavior. Created 3 years, 7 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
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 54dc7bbd336bc73f606cdad27254392eed83b148..f27e38a6f83d236116f3aa90d30313c21b552939 100644
--- a/cc/trees/layer_tree_host_impl.cc
+++ b/cc/trees/layer_tree_host_impl.cc
@@ -3237,6 +3237,14 @@ void LayerTreeHostImpl::ApplyScroll(ScrollNode* scroll_node,
scroll_node, delta, viewport_point,
scroll_state->is_direct_manipulation(),
&scroll_state->layer_tree_impl()->property_trees()->scroll_tree);
+ if (scroll_node->scroll_boundary_behavior.x !=
bokan 2017/05/19 19:35:57 I believe you'll also need similar logic in LTHI::
sunyunjia 2017/05/25 20:07:10 Done.
+ ScrollBoundaryBehavior::kScrollBoundaryBehaviorTypeAuto &&
+ std::abs(delta.x()) > std::abs(delta.y()))
+ applied_delta.set_x(delta.x());
+ if (scroll_node->scroll_boundary_behavior.y !=
+ ScrollBoundaryBehavior::kScrollBoundaryBehaviorTypeAuto &&
+ std::abs(delta.y()) > std::abs(delta.x()))
+ applied_delta.set_y(delta.y());
bokan 2017/05/19 19:35:57 I think we should do this in DistributeScrollDelta
sunyunjia 2017/05/25 20:07:10 Done.
}
// If the layer wasn't able to move, try the next one in the hierarchy.
@@ -3298,10 +3306,8 @@ void LayerTreeHostImpl::DistributeScrollDelta(ScrollState* scroll_state) {
break;
}
- if (!scroll_node->scrollable)
- continue;
-
- current_scroll_chain.push_front(scroll_node);
+ if (scroll_node->scrollable)
+ current_scroll_chain.push_front(scroll_node);
}
}
scroll_state->set_scroll_chain_and_layer_tree(current_scroll_chain,

Powered by Google App Engine
This is Rietveld 408576698