Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1032)

Unified Diff: Source/web/tests/ScrollingCoordinatorChromiumTest.cpp

Issue 747903005: Pass integer scroll position to CC if frameView has non-layered viewport constrained objects (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: restore to using ScrollingCoordinator::HasNonLayer Created 6 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: Source/web/tests/ScrollingCoordinatorChromiumTest.cpp
diff --git a/Source/web/tests/ScrollingCoordinatorChromiumTest.cpp b/Source/web/tests/ScrollingCoordinatorChromiumTest.cpp
index cdf1a04d84dc8f968b4bf63e8d02589767c9c35f..23ae32d1830f78f4e50dbd43b29d48a393a163cd 100644
--- a/Source/web/tests/ScrollingCoordinatorChromiumTest.cpp
+++ b/Source/web/tests/ScrollingCoordinatorChromiumTest.cpp
@@ -166,6 +166,27 @@ static WebLayer* webLayerFromElement(Element* element)
return graphicsLayer->platformLayer();
}
+
+TEST_F(ScrollingCoordinatorChromiumTest, fractionalScrollingNonLayerFixedPosition)
+{
+ registerMockedHttpURLLoad("fractional-scroll-fixed-position.html");
+ navigateTo(m_baseURL + "fractional-scroll-fixed-position.html");
+ // Prevent fixed-position element from getting its own layer.
+ webViewImpl()->settings()->setPreferCompositingToLCDTextEnabled(false);
+ forceFullCompositingUpdate();
+
+ FrameView* frameView = frame()->view();
+ frameView->scrollTo(DoublePoint(1.5, 1.5));
+ WebLayer* rootScrollLayer = getRootScrollLayer();
+ // Scroll on main if there is non-composited fixed position element.
+ // And the containing scroll layer should not get fractional scroll offset.
+ ASSERT_TRUE(rootScrollLayer->shouldScrollOnMainThread());
+ ASSERT_EQ(1.0, rootScrollLayer->scrollPositionDouble().x);
+ ASSERT_EQ(1.0, rootScrollLayer->scrollPositionDouble().y);
+ ASSERT_EQ(0.0, rootScrollLayer->position().x);
+ ASSERT_EQ(0.0, rootScrollLayer->position().y);
+}
+
TEST_F(ScrollingCoordinatorChromiumTest, fastScrollingForFixedPosition)
{
registerMockedHttpURLLoad("fixed-position.html");
« no previous file with comments | « Source/core/page/scrolling/ScrollingCoordinator.cpp ('k') | Source/web/tests/data/fractional-scroll-fixed-position.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698