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

Unified Diff: cc/trees/layer_tree_host_impl.cc

Issue 2243973002: Fix scroll chaining in CC for non-default RootScroller. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Addressed Tim's comments Created 4 years, 4 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_impl_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_impl.cc
diff --git a/cc/trees/layer_tree_host_impl.cc b/cc/trees/layer_tree_host_impl.cc
index e8348462663420c8cacdd4407214991975fc40d6..de691826b10553f245d3c38341cf1c911d1627c3 100644
--- a/cc/trees/layer_tree_host_impl.cc
+++ b/cc/trees/layer_tree_host_impl.cc
@@ -3103,12 +3103,19 @@ void LayerTreeHostImpl::DistributeScrollDelta(ScrollState* scroll_state) {
if (scroll_node) {
for (; scroll_tree.parent(scroll_node);
scroll_node = scroll_tree.parent(scroll_node)) {
- // Skip the outer viewport scroll layer so that we try to scroll the
- // viewport only once. i.e. The inner viewport layer represents the
- // viewport.
- if (!scroll_node->scrollable ||
- scroll_node->is_outer_viewport_scroll_layer)
+ if (scroll_node->is_outer_viewport_scroll_layer) {
+ // Don't chain scrolls past the outer viewport scroll layer. Once we
+ // reach that, we should scroll the viewport, which is represented by
+ // the inner viewport scroll layer.
+ ScrollNode* inner_viewport_scroll_node =
+ scroll_tree.Node(InnerViewportScrollLayer()->scroll_tree_index());
+ current_scroll_chain.push_front(inner_viewport_scroll_node);
+ break;
+ }
+
+ if (!scroll_node->scrollable)
continue;
+
current_scroll_chain.push_front(scroll_node);
}
}
« no previous file with comments | « no previous file | cc/trees/layer_tree_host_impl_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698