| 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 e2dbba06fd19fba4d4c501073bd104f508eddba0..13fe718fefb17095f3b91a3efb59020210a6d779 100644
|
| --- a/cc/trees/layer_tree_host_impl.cc
|
| +++ b/cc/trees/layer_tree_host_impl.cc
|
| @@ -2687,6 +2687,11 @@ InputHandler::ScrollStatus LayerTreeHostImpl::ScrollBegin(
|
| MainThreadScrollingReason::kNotScrollingOnMain;
|
| TRACE_EVENT0("cc", "LayerTreeHostImpl::ScrollBegin");
|
|
|
| + // On Mac a scroll begin with |inertial_phase| = true happens to handle a
|
| + // fling.
|
| + if (scroll_state->is_in_inertial_phase())
|
| + return FlingScrollBegin();
|
| +
|
| ClearCurrentlyScrollingLayer();
|
|
|
| gfx::Point viewport_point(scroll_state->position_x(),
|
| @@ -3234,7 +3239,12 @@ void LayerTreeHostImpl::ScrollEnd(ScrollState* scroll_state) {
|
|
|
| DistributeScrollDelta(scroll_state);
|
| top_controls_manager_->ScrollEnd();
|
| - ClearCurrentlyScrollingLayer();
|
| +
|
| + if (scroll_state->is_in_inertial_phase()) {
|
| + // Only clear the currently scrolling layer if we know the scroll is done.
|
| + // A non-inertial scroll end could be followed by an inertial scroll.
|
| + ClearCurrentlyScrollingLayer();
|
| + }
|
| }
|
|
|
| InputHandler::ScrollStatus LayerTreeHostImpl::FlingScrollBegin() {
|
|
|