summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--cc/trees/layer_tree_host_impl.cc9
-rw-r--r--cc/trees/layer_tree_host_impl_unittest.cc9
2 files changed, 3 insertions, 15 deletions
diff --git a/cc/trees/layer_tree_host_impl.cc b/cc/trees/layer_tree_host_impl.cc
index 628fc59..38d903e 100644
--- a/cc/trees/layer_tree_host_impl.cc
+++ b/cc/trees/layer_tree_host_impl.cc
@@ -2829,15 +2829,12 @@ void LayerTreeHostImpl::ScrollEnd() {
}
InputHandler::ScrollStatus LayerTreeHostImpl::FlingScrollBegin() {
- if (!CurrentlyScrollingLayer())
+ if (!active_tree_->CurrentlyScrollingLayer())
return SCROLL_IGNORED;
- bool currently_scrolling_viewport =
- CurrentlyScrollingLayer() == OuterViewportScrollLayer() ||
- CurrentlyScrollingLayer() == InnerViewportScrollLayer();
- if (!wheel_scrolling_ && !currently_scrolling_viewport) {
+ if (!wheel_scrolling_) {
// Allow the fling to lock to the first layer that moves after the initial
- // fling |ScrollBy()| event, unless we're already scrolling the viewport.
+ // fling |ScrollBy()| event.
did_lock_scrolling_layer_ = false;
should_bubble_scrolls_ = false;
}
diff --git a/cc/trees/layer_tree_host_impl_unittest.cc b/cc/trees/layer_tree_host_impl_unittest.cc
index b8dbc1e..a8f0324 100644
--- a/cc/trees/layer_tree_host_impl_unittest.cc
+++ b/cc/trees/layer_tree_host_impl_unittest.cc
@@ -7393,17 +7393,13 @@ TEST_F(LayerTreeHostImplVirtualViewportTest, FlingScrollBubblesToInner) {
// Make sure the fling goes to the outer viewport first
EXPECT_EQ(InputHandler::SCROLL_STARTED,
host_impl_->ScrollBegin(gfx::Point(), InputHandler::GESTURE));
- EXPECT_EQ(outer_scroll, host_impl_->CurrentlyScrollingLayer());
EXPECT_EQ(InputHandler::SCROLL_STARTED, host_impl_->FlingScrollBegin());
- EXPECT_EQ(outer_scroll, host_impl_->CurrentlyScrollingLayer());
gfx::Vector2d scroll_delta(inner_viewport.width(), inner_viewport.height());
host_impl_->ScrollBy(gfx::Point(), scroll_delta);
outer_expected += gfx::Vector2dF(scroll_delta.x(), scroll_delta.y());
- EXPECT_EQ(host_impl_->CurrentlyScrollingLayer(), outer_scroll);
host_impl_->ScrollEnd();
- EXPECT_EQ(nullptr, host_impl_->CurrentlyScrollingLayer());
EXPECT_VECTOR_EQ(inner_expected, inner_scroll->CurrentScrollOffset());
EXPECT_VECTOR_EQ(outer_expected, outer_scroll->CurrentScrollOffset());
@@ -7411,20 +7407,15 @@ TEST_F(LayerTreeHostImplVirtualViewportTest, FlingScrollBubblesToInner) {
// Fling past the outer viewport boundry, make sure inner viewport scrolls.
EXPECT_EQ(InputHandler::SCROLL_STARTED,
host_impl_->ScrollBegin(gfx::Point(), InputHandler::GESTURE));
- EXPECT_EQ(outer_scroll, host_impl_->CurrentlyScrollingLayer());
EXPECT_EQ(InputHandler::SCROLL_STARTED, host_impl_->FlingScrollBegin());
- EXPECT_EQ(outer_scroll, host_impl_->CurrentlyScrollingLayer());
host_impl_->ScrollBy(gfx::Point(), scroll_delta);
outer_expected += gfx::Vector2dF(scroll_delta.x(), scroll_delta.y());
- EXPECT_EQ(outer_scroll, host_impl_->CurrentlyScrollingLayer());
host_impl_->ScrollBy(gfx::Point(), scroll_delta);
inner_expected += gfx::Vector2dF(scroll_delta.x(), scroll_delta.y());
- EXPECT_EQ(outer_scroll, host_impl_->CurrentlyScrollingLayer());
host_impl_->ScrollEnd();
- EXPECT_EQ(nullptr, host_impl_->CurrentlyScrollingLayer());
EXPECT_VECTOR_EQ(inner_expected, inner_scroll->CurrentScrollOffset());
EXPECT_VECTOR_EQ(outer_expected, outer_scroll->CurrentScrollOffset());