summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorjdduke <jdduke@chromium.org>2015-08-07 21:15:49 -0700
committerCommit bot <commit-bot@chromium.org>2015-08-08 04:16:18 +0000
commit7168c3a89473e240d8d9692fbf21606b58321082 (patch)
treeb8434ea84cc47ef59b06a4aa3c9a248e34e0a575
parent2157a2dbefa09dacff5aa8c56f3aaec640cb28d1 (diff)
downloadchromium_src-7168c3a89473e240d8d9692fbf21606b58321082.zip
chromium_src-7168c3a89473e240d8d9692fbf21606b58321082.tar.gz
chromium_src-7168c3a89473e240d8d9692fbf21606b58321082.tar.bz2
Revert of Preserve viewport scrolling layer when a fling starts (patchset #2 id:20001 of https://codereview.chromium.org/1225693008/ )
Reason for revert: Causes issues with WebView when the embedder overrides computeScroll. Original issue's description: > Preserve viewport scrolling layer when a fling starts > > A touch fling will lock the scrolling layer to the first layer that > scrolls after the animation begins. This can disrupt viewport scrolling > if the outer viewport was the originally targetted scroll layer, e.g., > by resetting bookkeeping for scrollbar fade animations. Prevent this > by allowing scroll bubbling if the viewport is the locked layer when > the fling starts. > > BUG=507786 > CQ_INCLUDE_TRYBOTS=tryserver.blink:linux_blink_rel > > Committed: https://crrev.com/89192797b50f7e33967445095cd7fa16b78f68e1 > Cr-Commit-Position: refs/heads/master@{#337747} TBR=aelias@chromium.org NOPRESUBMIT=true NOTREECHECKS=true NOTRY=true BUG=507786,516362 Review URL: https://codereview.chromium.org/1280113003 Cr-Commit-Position: refs/heads/master@{#342514}
-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());