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

Unified Diff: cc/trees/layer_tree_host_impl.cc

Issue 776943004: Properly handle viewport-flings after a bubbling scroll (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Minor fix Created 6 years 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 566fb577d2ff5f489ac82846e6d20ba075f924a7..fc3ffdb95b5898ec66958f64879851cd95d8734c 100644
--- a/cc/trees/layer_tree_host_impl.cc
+++ b/cc/trees/layer_tree_host_impl.cc
@@ -2681,10 +2681,16 @@ InputHandlerScrollResult LayerTreeHostImpl::ScrollBy(
}
did_lock_scrolling_layer_ = true;
- if (!allow_bubbling_for_current_layer) {
+
+ // When scrolls are allowed to bubble, it's important that the original
+ // scrolling layer be preserved. This ensures that, after a scroll bubbles,
+ // the user can reverse scroll directions and immediately resume scrolling
+ // the original layer that scrolled.
+ if (!should_bubble_scrolls_)
active_tree_->SetCurrentlyScrollingLayer(layer_impl);
+
+ if (!allow_bubbling_for_current_layer)
break;
- }
if (allow_unrestricted_bubbling_for_current_layer) {
pending_delta -= applied_delta;
« 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