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

Unified Diff: third_party/WebKit/Source/core/paint/PaintLayerScrollableAreaTest.cpp

Issue 2595593002: Fix CSS clips cannot be correctly handled by composited scroller (Closed)
Patch Set: Add unit test && nit Created 4 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
« no previous file with comments | « third_party/WebKit/Source/core/paint/PaintLayerScrollableArea.cpp ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/core/paint/PaintLayerScrollableAreaTest.cpp
diff --git a/third_party/WebKit/Source/core/paint/PaintLayerScrollableAreaTest.cpp b/third_party/WebKit/Source/core/paint/PaintLayerScrollableAreaTest.cpp
index fe8363771987342c1d82a6522eb44bdd21f3cf1f..e8cf0304d3902a19f43177471dc23b6e68e523ce 100644
--- a/third_party/WebKit/Source/core/paint/PaintLayerScrollableAreaTest.cpp
+++ b/third_party/WebKit/Source/core/paint/PaintLayerScrollableAreaTest.cpp
@@ -462,4 +462,40 @@ TEST_F(PaintLayerScrollableAreaTest, OverlayScrollbarColorThemeUpdated) {
ASSERT_EQ(ScrollbarOverlayColorTheme::ScrollbarOverlayColorThemeLight,
blackLayer->getScrollableArea()->getScrollbarOverlayColorTheme());
}
+
+// Test that css clip applied to the scroller will cause the
+// scrolling contents layer to not be promoted.
+TEST_F(PaintLayerScrollableAreaTest,
+ OnlyAutoClippedScrollingContentsLayerPromoted) {
+ setBodyInnerHTML(
+ "<style>"
+ ".clip { clip: rect(0px,60px,50px,0px); }"
+ "#scroller { position: absolute; overflow: auto;"
+ "height: 100px; width: 100px; background: grey;"
+ "will-change:transform; }"
+ "#scrolled { height: 300px; }"
+ "</style>"
+ "<div id=\"scroller\"><div id=\"scrolled\"></div></div>");
+ document().view()->updateAllLifecyclePhases();
+
+ Element* scroller = document().getElementById("scroller");
+ PaintLayer* paintLayer =
+ toLayoutBoxModelObject(scroller->layoutObject())->layer();
+ ASSERT_TRUE(paintLayer);
+ EXPECT_TRUE(paintLayer->needsCompositedScrolling());
+
+ // Add clip to scroller.
+ scroller->setAttribute("class", "clip", ASSERT_NO_EXCEPTION);
+ document().view()->updateAllLifecyclePhases();
+ paintLayer = toLayoutBoxModelObject(scroller->layoutObject())->layer();
+ ASSERT_TRUE(paintLayer);
+ EXPECT_FALSE(paintLayer->needsCompositedScrolling());
+
+ // Change the scroller to be auto clipped again.
+ scroller->removeAttribute("class");
+ document().view()->updateAllLifecyclePhases();
+ paintLayer = toLayoutBoxModelObject(scroller->layoutObject())->layer();
+ ASSERT_TRUE(paintLayer);
+ EXPECT_TRUE(paintLayer->needsCompositedScrolling());
+}
}
« no previous file with comments | « third_party/WebKit/Source/core/paint/PaintLayerScrollableArea.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698