Chromium Code Reviews| 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 fa3ba0e599df1d93f2bbd0fdf3c7ce6f33c2a9cd..0fc053cef803f722a5fdb944f62a904f332983ba 100644 |
| --- a/cc/trees/layer_tree_host_impl.cc |
| +++ b/cc/trees/layer_tree_host_impl.cc |
| @@ -180,7 +180,6 @@ LayerTreeHostImpl::LayerTreeHostImpl( |
| tree_resources_for_gpu_rasterization_dirty_(false), |
| input_handler_client_(NULL), |
| did_lock_scrolling_layer_(false), |
| - should_bubble_scrolls_(false), |
| wheel_scrolling_(false), |
| scroll_affects_scroll_handler_(false), |
| scroll_layer_id_when_mouse_over_scrollbar_(0), |
| @@ -2396,7 +2395,6 @@ InputHandler::ScrollStatus LayerTreeHostImpl::ScrollBeginImpl( |
| top_controls_manager_->ScrollBegin(); |
| active_tree_->SetCurrentlyScrollingLayer(scrolling_layer_impl); |
| - should_bubble_scrolls_ = (type != NON_BUBBLING_GESTURE); |
| wheel_scrolling_ = (type == WHEEL); |
| client_->RenewTreePriority(); |
| UMA_HISTOGRAM_BOOLEAN("TryScroll.SlowScroll", false); |
| @@ -2439,6 +2437,10 @@ InputHandler::ScrollStatus LayerTreeHostImpl::ScrollBegin( |
| device_viewport_point, type, layer_impl, &scroll_on_main_thread, |
| &scroll_affects_scroll_handler_); |
| + // The inner viewport layer represents the viewport during scrolling. |
|
jdduke (slow)
2015/09/09 14:41:10
Should we instead move this adjustment into FindSc
tdresser
2015/09/10 13:56:51
Absolutely, thanks.
Done.
|
| + if (scrolling_layer_impl == OuterViewportScrollLayer()) |
| + scrolling_layer_impl = InnerViewportScrollLayer(); |
| + |
| if (scroll_on_main_thread) { |
| UMA_HISTOGRAM_BOOLEAN("TryScroll.SlowScroll", true); |
| return SCROLL_ON_MAIN_THREAD; |
| @@ -2643,12 +2645,8 @@ void LayerTreeHostImpl::ApplyScroll(LayerImpl* layer, |
| if (!scrolled) |
| return; |
| - // 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 (!scroll_state->should_propagate()) |
| - scroll_state->set_current_native_scrolling_layer(layer); |
| + |
| + scroll_state->set_current_native_scrolling_layer(layer); |
| } |
| InputHandlerScrollResult LayerTreeHostImpl::ScrollBy( |
| @@ -2662,7 +2660,7 @@ InputHandlerScrollResult LayerTreeHostImpl::ScrollBy( |
| top_controls_manager_->ControlsTopOffset(); |
| ScrollState scroll_state( |
| scroll_delta.x(), scroll_delta.y(), viewport_point.x(), |
| - viewport_point.y(), should_bubble_scrolls_ /* should_propagate */, |
| + viewport_point.y(), false /* should_propagate */, |
| did_lock_scrolling_layer_ /* delta_consumed_for_scroll_sequence */, |
| !wheel_scrolling_ /* is_direct_manipulation */); |
| scroll_state.set_current_native_scrolling_layer(CurrentlyScrollingLayer()); |
| @@ -2800,16 +2798,6 @@ InputHandler::ScrollStatus LayerTreeHostImpl::FlingScrollBegin() { |
| if (!CurrentlyScrollingLayer()) |
| return SCROLL_IGNORED; |
| - bool currently_scrolling_viewport = |
| - CurrentlyScrollingLayer() == OuterViewportScrollLayer() || |
| - CurrentlyScrollingLayer() == InnerViewportScrollLayer(); |
| - if (!wheel_scrolling_ && !currently_scrolling_viewport) { |
| - // Allow the fling to lock to the first layer that moves after the initial |
| - // fling |ScrollBy()| event, unless we're already scrolling the viewport. |
| - did_lock_scrolling_layer_ = false; |
| - should_bubble_scrolls_ = false; |
| - } |
| - |
| return SCROLL_STARTED; |
| } |