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

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

Issue 2511893002: Paint solid color background into both scrolling contents layer and graphics layer. (Closed)
Patch Set: Created 4 years, 1 month 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: 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 237e22190512fdcba26b6735648e2a823dbed1d9..b272cb852171fad214e315f7edcb10464874a552 100644
--- a/third_party/WebKit/Source/core/paint/PaintLayerScrollableAreaTest.cpp
+++ b/third_party/WebKit/Source/core/paint/PaintLayerScrollableAreaTest.cpp
@@ -19,10 +19,10 @@ class PaintLayerScrollableAreaTest : public RenderingTest {
PaintLayerScrollableAreaTest()
: RenderingTest(SingleChildFrameLoaderClient::create()) {}
- bool canPaintBackgroundOntoScrollingContentsLayer(const char* elementId) {
+ BackgroundPaintLocation backgroundPaintLocation(const char* elementId) {
chrishtr 2016/11/17 20:55:39 Is one of the tests below exercising solid-color b
flackr 2016/11/17 23:38:00 Yes, scroller10 and scroller13 test solid color ba
PaintLayer* paintLayer =
toLayoutBoxModelObject(getLayoutObjectByElementId(elementId))->layer();
- return paintLayer->canPaintBackgroundOntoScrollingContentsLayer();
+ return paintLayer->backgroundPaintLocation();
}
private:
@@ -87,72 +87,88 @@ TEST_F(PaintLayerScrollableAreaTest,
// #scroller1 cannot paint background into scrolling contents layer because it
// has a negative z-index child.
- EXPECT_FALSE(canPaintBackgroundOntoScrollingContentsLayer("scroller1"));
+ EXPECT_EQ(BackgroundPaintInGraphicsLayer,
+ backgroundPaintLocation("scroller1"));
// #scroller2 cannot paint background into scrolling contents layer because it
// has a content-box clip without local attachment.
- EXPECT_FALSE(canPaintBackgroundOntoScrollingContentsLayer("scroller2"));
+ EXPECT_EQ(BackgroundPaintInGraphicsLayer,
+ backgroundPaintLocation("scroller2"));
// #scroller3 can paint background into scrolling contents layer.
- EXPECT_TRUE(canPaintBackgroundOntoScrollingContentsLayer("scroller3"));
+ EXPECT_EQ(BackgroundPaintInScrollingContents,
+ backgroundPaintLocation("scroller3"));
// #scroller4 cannot paint background into scrolling contents layer because
// the background image is not locally attached.
- EXPECT_FALSE(canPaintBackgroundOntoScrollingContentsLayer("scroller4"));
+ EXPECT_EQ(BackgroundPaintInGraphicsLayer,
+ backgroundPaintLocation("scroller4"));
// #scroller5 can paint background into scrolling contents layer because both
// the image and color are locally attached.
- EXPECT_TRUE(canPaintBackgroundOntoScrollingContentsLayer("scroller5"));
+ EXPECT_EQ(BackgroundPaintInScrollingContents,
+ backgroundPaintLocation("scroller5"));
// #scroller6 can paint background into scrolling contents layer because the
// image is locally attached and even though the color is not, it is filled to
// the padding box so it will be drawn the same as a locally attached
// background.
- EXPECT_TRUE(canPaintBackgroundOntoScrollingContentsLayer("scroller6"));
+ EXPECT_EQ(BackgroundPaintInScrollingContents,
+ backgroundPaintLocation("scroller6"));
// #scroller7 cannot paint background into scrolling contents layer because
// the color is filled to the content box and we have padding so it is not
// equivalent to a locally attached background.
- EXPECT_FALSE(canPaintBackgroundOntoScrollingContentsLayer("scroller7"));
+ EXPECT_EQ(BackgroundPaintInGraphicsLayer,
+ backgroundPaintLocation("scroller7"));
// #scroller8 can paint background into scrolling contents layer because its
// border-box is equivalent to its padding box since it has no border.
- EXPECT_TRUE(canPaintBackgroundOntoScrollingContentsLayer("scroller8"));
+ EXPECT_EQ(BackgroundPaintInScrollingContents,
+ backgroundPaintLocation("scroller8"));
// #scroller9 can paint background into scrolling contents layer because its
// border is opaque so it completely covers the background outside of the
// padding-box.
- EXPECT_TRUE(canPaintBackgroundOntoScrollingContentsLayer("scroller9"));
+ EXPECT_EQ(BackgroundPaintInScrollingContents,
+ backgroundPaintLocation("scroller9"));
- // #scroller10 cannot paint background into scrolling contents layer because
- // its border is partially transparent so the background must be drawn to the
+ // #scroller10 paints the background into both layers because its border is
+ // partially transparent so the background must be drawn to the
// border-box edges.
- EXPECT_FALSE(canPaintBackgroundOntoScrollingContentsLayer("scroller10"));
+ EXPECT_EQ(BackgroundPaintInGraphicsLayer | BackgroundPaintInScrollingContents,
+ backgroundPaintLocation("scroller10"));
// #scroller11 can paint background into scrolling contents layer because its
// content-box is equivalent to its padding box since it has no padding.
- EXPECT_TRUE(canPaintBackgroundOntoScrollingContentsLayer("scroller11"));
+ EXPECT_EQ(BackgroundPaintInScrollingContents,
+ backgroundPaintLocation("scroller11"));
// #scroller12 cannot paint background into scrolling contents layer because
// it has padding so its content-box is not equivalent to its padding-box.
- EXPECT_FALSE(canPaintBackgroundOntoScrollingContentsLayer("scroller12"));
+ EXPECT_EQ(BackgroundPaintInGraphicsLayer,
+ backgroundPaintLocation("scroller12"));
- // #scroller13 cannot paint background into scrolling contents layer because
- // it has a custom scrollbar which the background may need to draw under.
- EXPECT_FALSE(canPaintBackgroundOntoScrollingContentsLayer("scroller13"));
+ // #scroller13 paints the background into both layers because it has a custom
+ // scrollbar which the background may need to draw under.
+ EXPECT_EQ(BackgroundPaintInGraphicsLayer | BackgroundPaintInScrollingContents,
+ backgroundPaintLocation("scroller13"));
// #scroller14 can paint background into scrolling contents layer because the
// outline is drawn outside the padding box.
- EXPECT_TRUE(canPaintBackgroundOntoScrollingContentsLayer("scroller14"));
+ EXPECT_EQ(BackgroundPaintInScrollingContents,
+ backgroundPaintLocation("scroller14"));
// #scroller15 cannot paint background into scrolling contents layer because
// the outline is drawn inside the padding box.
- EXPECT_FALSE(canPaintBackgroundOntoScrollingContentsLayer("scroller15"));
+ EXPECT_EQ(BackgroundPaintInGraphicsLayer,
+ backgroundPaintLocation("scroller15"));
// #scroller16 cannot paint background into scrolling contents layer because
// the scroller has a clip which would not be respected by the scrolling
// contents layer.
- EXPECT_FALSE(canPaintBackgroundOntoScrollingContentsLayer("scroller16"));
+ EXPECT_EQ(BackgroundPaintInGraphicsLayer,
+ backgroundPaintLocation("scroller16"));
}
TEST_F(PaintLayerScrollableAreaTest, OpaqueLayersPromoted) {

Powered by Google App Engine
This is Rietveld 408576698