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

Unified Diff: cc/trees/layer_tree_host_impl.cc

Issue 737943002: Update from https://crrev.com/304715 (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 6 years, 1 month 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_common_unittest.cc ('k') | 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 ffe2ddb731aad2a0efd5550b35f3a2bde2d45b4c..bb1be9856d093663f5533a2c4a6cff40c0a50cfd 100644
--- a/cc/trees/layer_tree_host_impl.cc
+++ b/cc/trees/layer_tree_host_impl.cc
@@ -2567,7 +2567,18 @@ InputHandlerScrollResult LayerTreeHostImpl::ScrollBy(
bool consume_by_top_controls = ShouldTopControlsConsumeScroll(scroll_delta);
- for (LayerImpl* layer_impl = CurrentlyScrollingLayer();
+ // There's an edge case where the outer viewport isn't scrollable when the
+ // scroll starts, however, as the top controls show the outer viewport becomes
+ // scrollable. Therefore, always try scrolling the outer viewport before the
+ // inner.
+ // TODO(bokan): Move the top controls logic out of the loop since the scroll
+ // that causes the outer viewport to become scrollable will still be applied
+ // to the inner viewport.
+ LayerImpl* start_layer = CurrentlyScrollingLayer();
+ if (start_layer == InnerViewportScrollLayer() && OuterViewportScrollLayer())
+ start_layer = OuterViewportScrollLayer();
+
+ for (LayerImpl* layer_impl = start_layer;
layer_impl;
layer_impl = layer_impl->parent()) {
if (!layer_impl->scrollable())
« no previous file with comments | « cc/trees/layer_tree_host_common_unittest.cc ('k') | cc/trees/layer_tree_host_impl_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698