| Index: third_party/WebKit/LayoutTests/compositing/overflow/overflow-scroll-with-opaque-background.html
|
| diff --git a/third_party/WebKit/LayoutTests/compositing/overflow/overflow-scroll-with-opaque-background.html b/third_party/WebKit/LayoutTests/compositing/overflow/overflow-scroll-with-opaque-background.html
|
| new file mode 100644
|
| index 0000000000000000000000000000000000000000..ac1de10ab5c0fa8c5306df080fcb1fd207d66297
|
| --- /dev/null
|
| +++ b/third_party/WebKit/LayoutTests/compositing/overflow/overflow-scroll-with-opaque-background.html
|
| @@ -0,0 +1,48 @@
|
| +<script>
|
| +if (window.testRunner)
|
| + window.testRunner.dumpAsText();
|
| +
|
| +function hasOpaqueCompositedScrollingContentsLayer(layer) {
|
| + if (layer.name == "Scrolling Contents Layer")
|
| + return layer.contentsOpaque;
|
| + if (layer.children) {
|
| + for (var i = 0; i < layer.children.length; i++) {
|
| + if (hasOpaqueCompositedScrollingContentsLayer(layer.children[i]))
|
| + return true;
|
| + }
|
| + }
|
| + return false;
|
| +}
|
| +
|
| +onload = function() {
|
| + if (!window.testRunner || !window.internals)
|
| + return;
|
| +
|
| + var result = "";
|
| + result += "Should have opaque composited scrolling contents layer: ";
|
| + if (hasOpaqueCompositedScrollingContentsLayer(JSON.parse(window.internals.layerTreeAsText(document))))
|
| + result += "Pass.\n";
|
| + else
|
| + result += "Fail.\n";
|
| + window.testRunner.setCustomTextOutput(result);
|
| +}
|
| +</script>
|
| +<style>
|
| +#scroller {
|
| + background: white local content-box;
|
| + border: 10px solid rgba(0, 255, 0, 0.5);
|
| + overflow: scroll;
|
| + width: 200px;
|
| + height: 200px;
|
| + will-change: transform;
|
| +}
|
| +.spacer {
|
| + height: 300px;
|
| +}
|
| +</style>
|
| +<!-- The scroller's Scrolling Contents Layer should be opaque due to the opaque
|
| + color background. Even though the background has a content-box clip there
|
| + is no gap because the scroller has no padding. This means that we will be
|
| + able to draw text with subpixel anti-aliasing.
|
| +-->
|
| +<div id="scroller"><div class="spacer"></div></div>
|
|
|