| 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 e6db70e6cbf14ee4bb5643da1ca6ed8efd3569dc..2a9e01ff2c265eb162282cc9bd68659b134eae0f 100644
|
| --- a/cc/trees/layer_tree_host_impl.cc
|
| +++ b/cc/trees/layer_tree_host_impl.cc
|
| @@ -2684,8 +2684,12 @@ InputHandler::ScrollStatus LayerTreeHostImpl::ScrollBegin(
|
| ScrollStatus scroll_status;
|
| scroll_status.main_thread_scrolling_reasons =
|
| MainThreadScrollingReason::kNotScrollingOnMain;
|
| +
|
| TRACE_EVENT0("cc", "LayerTreeHostImpl::ScrollBegin");
|
|
|
| + if (scroll_state->is_in_inertial_phase())
|
| + return FlingScrollBegin();
|
| +
|
| ClearCurrentlyScrollingLayer();
|
|
|
| gfx::Point viewport_point(scroll_state->position_x(),
|
| @@ -3238,7 +3242,13 @@ void LayerTreeHostImpl::ScrollEnd(ScrollState* scroll_state) {
|
|
|
| DistributeScrollDelta(scroll_state);
|
| top_controls_manager_->ScrollEnd();
|
| - ClearCurrentlyScrollingLayer();
|
| +
|
| + if (scroll_state->is_in_inertial_phase()) {
|
| + // There might be a fling after the scroll end. In those cases,
|
| + // don't clear the currently scrolling layer to avoid a new hit test for the
|
| + // fling.
|
| + ClearCurrentlyScrollingLayer();
|
| + }
|
| }
|
|
|
| InputHandler::ScrollStatus LayerTreeHostImpl::FlingScrollBegin() {
|
|
|