| 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 1a14130ba4d825265b4394adeb4779e0f8850cbe..91e62289b389bddc93234aee1be48f0a1f2e9448 100644
|
| --- a/third_party/WebKit/Source/core/paint/PaintLayerScrollableAreaTest.cpp
|
| +++ b/third_party/WebKit/Source/core/paint/PaintLayerScrollableAreaTest.cpp
|
| @@ -12,7 +12,10 @@ TEST_F(PaintLayerScrollableAreaTest, ShouldPaintBackgroundOntoScrollingContentsL
|
| {
|
| document().frame()->settings()->setPreferCompositingToLCDTextEnabled(true);
|
| setBodyInnerHTML(
|
| - "<style>.scroller { overflow: scroll; will-change: transform; width: 300px; height: 300px;} .spacer { height: 1000px; }</style>"
|
| + "<style>"
|
| + ".scroller { overflow: scroll; will-change: transform; width: 300px; height: 300px;} .spacer { height: 1000px; }"
|
| + "#scroller13::-webkit-scrollbar { width: 13px; height: 13px;}"
|
| + "</style>"
|
| "<div id='scroller1' class='scroller' style='background: white local;'>"
|
| " <div id='negative-composited-child' style='background-color: red; width: 1px; height: 1px; position: absolute; backface-visibility: hidden; z-index: -1'></div>"
|
| " <div class='spacer'></div>"
|
| @@ -23,30 +26,70 @@ TEST_F(PaintLayerScrollableAreaTest, ShouldPaintBackgroundOntoScrollingContentsL
|
| "<div id='scroller5' class='scroller' style='background: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUg) local, white local;'><div class='spacer'></div></div>"
|
| "<div id='scroller6' class='scroller' style='background: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUg) local, white padding-box; padding: 10px;'><div class='spacer'></div></div>"
|
| "<div id='scroller7' class='scroller' style='background: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUg) local, white content-box; padding: 10px;'><div class='spacer'></div></div>"
|
| + "<div id='scroller8' class='scroller' style='background: white border-box;'><div class='spacer'></div></div>"
|
| + "<div id='scroller9' class='scroller' style='background: white border-box; border: 10px solid black;'><div class='spacer'></div></div>"
|
| + "<div id='scroller10' class='scroller' style='background: white border-box; border: 10px solid rgba(0, 0, 0, 0.5);'><div class='spacer'></div></div>"
|
| + "<div id='scroller11' class='scroller' style='background: white content-box;'><div class='spacer'></div></div>"
|
| + "<div id='scroller12' class='scroller' style='background: white content-box; padding: 10px;'><div class='spacer'></div></div>"
|
| + "<div id='scroller13' class='scroller' style='background: white border-box;'><div class='spacer'></div></div>"
|
| + "<div id='scroller14' class='scroller' style='background: white; border: 1px solid black; outline: 1px solid blue; outline-offset: -1px;'><div class='spacer'></div></div>"
|
| + "<div id='scroller15' class='scroller' style='background: white; border: 1px solid black; outline: 1px solid blue; outline-offset: -2px;'><div class='spacer'></div></div>"
|
| );
|
|
|
| - // First scroller cannot paint background into scrolling contents layer because it has a negative z-index child.
|
| + // #scroller1 cannot paint background into scrolling contents layer because it has a negative z-index child.
|
| EXPECT_FALSE(shouldPaintBackgroundOntoScrollingContentsLayer("scroller1"));
|
|
|
| - // Second scroller cannot paint background into scrolling contents layer because it has a content-box clip without local attachment.
|
| + // #scroller2 cannot paint background into scrolling contents layer because it has a content-box clip without local attachment.
|
| EXPECT_FALSE(shouldPaintBackgroundOntoScrollingContentsLayer("scroller2"));
|
|
|
| - // Third scroller can paint background into scrolling contents layer.
|
| + // #scroller3 can paint background into scrolling contents layer.
|
| EXPECT_TRUE(shouldPaintBackgroundOntoScrollingContentsLayer("scroller3"));
|
|
|
| - // Fourth scroller cannot paint background into scrolling contents layer because the background image is not locally attached.
|
| + // #scroller4 cannot paint background into scrolling contents layer because the background image is not locally attached.
|
| EXPECT_FALSE(shouldPaintBackgroundOntoScrollingContentsLayer("scroller4"));
|
|
|
| - // Fifth scroller can paint background into scrolling contents layer because both the image and color are locally attached.
|
| + // #scroller5 can paint background into scrolling contents layer because both the image and color are locally attached.
|
| EXPECT_TRUE(shouldPaintBackgroundOntoScrollingContentsLayer("scroller5"));
|
|
|
| - // Sixth scroller can paint background into scrolling contents layer because the image is locally attached and even though
|
| + // #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(shouldPaintBackgroundOntoScrollingContentsLayer("scroller6"));
|
|
|
| - // Seventh scroller cannot paint background into scrolling contents layer because the color is filled to the content
|
| + // #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(shouldPaintBackgroundOntoScrollingContentsLayer("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(shouldPaintBackgroundOntoScrollingContentsLayer("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(shouldPaintBackgroundOntoScrollingContentsLayer("scroller9"));
|
| +
|
| + // #scroller10 cannot paint background into scrolling contents layer because its border is partially transparent
|
| + // so the background must be drawn to the border-box edges.
|
| + EXPECT_FALSE(shouldPaintBackgroundOntoScrollingContentsLayer("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(shouldPaintBackgroundOntoScrollingContentsLayer("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(shouldPaintBackgroundOntoScrollingContentsLayer("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(shouldPaintBackgroundOntoScrollingContentsLayer("scroller13"));
|
| +
|
| + // #scroller14 can paint background into scrolling contents layer because the outline is drawn outside the
|
| + // padding box.
|
| + EXPECT_TRUE(shouldPaintBackgroundOntoScrollingContentsLayer("scroller14"));
|
| +
|
| + // #scroller15 cannot paint background into scrolling contents layer because the outline is drawn inside
|
| + // the padding box.
|
| + EXPECT_FALSE(shouldPaintBackgroundOntoScrollingContentsLayer("scroller15"));
|
| }
|
|
|
| TEST_F(PaintLayerScrollableAreaTest, OpaqueLayersPromoted)
|
|
|