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

Unified Diff: cc/trees/layer_tree_host_impl.cc

Issue 105393003: Always fall back to root scroll layer for otherwise ignored scrolls (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Use max scroll offset Created 6 years, 11 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 9b003631b40c2cea250da6a6b2d268a10a6a109a..f051b335a70ccf4848505efcdc6d8b664c74abee 100644
--- a/cc/trees/layer_tree_host_impl.cc
+++ b/cc/trees/layer_tree_host_impl.cc
@@ -2010,15 +2010,6 @@ LayerImpl* LayerTreeHostImpl::FindScrollLayerForDeviceViewportPoint(
potentially_scrolling_layer_impl = scroll_layer_impl;
}
- // When hiding top controls is enabled and the controls are hidden or
- // overlaying the content, force scrolls to be enabled on the root layer to
- // allow bringing the top controls back into view.
- if (!potentially_scrolling_layer_impl && top_controls_manager_ &&
- top_controls_manager_->content_top_offset() !=
- settings_.top_controls_height) {
- potentially_scrolling_layer_impl = RootScrollLayer();
- }
-
return potentially_scrolling_layer_impl;
}
@@ -2050,8 +2041,7 @@ InputHandler::ScrollStatus LayerTreeHostImpl::ScrollBegin(
return ScrollOnMainThread;
}
- // If we want to send a DidOverscroll for this scroll it can't be ignored.
- if (!potentially_scrolling_layer_impl && settings_.always_overscroll)
+ if (!potentially_scrolling_layer_impl)
potentially_scrolling_layer_impl = RootScrollLayer();
if (potentially_scrolling_layer_impl) {
@@ -2160,7 +2150,9 @@ bool LayerTreeHostImpl::ScrollBy(gfx::Point viewport_point,
bool did_scroll_x = false;
bool did_scroll_y = false;
bool consume_by_top_controls = top_controls_manager_ &&
- (CurrentlyScrollingLayer() == RootScrollLayer() || scroll_delta.y() < 0);
+ (scroll_delta.y() < 0 ||
+ (RootScrollLayer() && CurrentlyScrollingLayer() == RootScrollLayer() &&
+ RootScrollLayer()->max_scroll_offset().y() > 0));
for (LayerImpl* layer_impl = CurrentlyScrollingLayer();
layer_impl;
@@ -2171,7 +2163,7 @@ bool LayerTreeHostImpl::ScrollBy(gfx::Point viewport_point,
if (layer_impl == RootScrollLayer()) {
// Only allow bubble scrolling when the scroll is in the direction to make
// the top controls visible.
- if (consume_by_top_controls && layer_impl == RootScrollLayer()) {
+ if (consume_by_top_controls) {
pending_delta = top_controls_manager_->ScrollBy(pending_delta);
UpdateMaxScrollOffset();
}
« 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