| Index: third_party/WebKit/LayoutTests/compositing/overflow/overflow-scroll-background-transparent-to-opaque.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-background-transparent-to-opaque.html
|
| similarity index 52%
|
| copy from third_party/WebKit/LayoutTests/compositing/overflow/overflow-scroll-with-opaque-background.html
|
| copy to third_party/WebKit/LayoutTests/compositing/overflow/overflow-scroll-background-transparent-to-opaque.html
|
| index ac1de10ab5c0fa8c5306df080fcb1fd207d66297..d199be870024c9c60a3d0ffcda657ca23915cccc 100644
|
| --- a/third_party/WebKit/LayoutTests/compositing/overflow/overflow-scroll-with-opaque-background.html
|
| +++ b/third_party/WebKit/LayoutTests/compositing/overflow/overflow-scroll-background-transparent-to-opaque.html
|
| @@ -1,6 +1,10 @@
|
| +<!DOCTYPE html>
|
| +<html>
|
| +<head>
|
| +<script src="../../resources/run-after-layout-and-paint.js"></script>
|
| <script>
|
| -if (window.testRunner)
|
| - window.testRunner.dumpAsText();
|
| +if (window.internals)
|
| + internals.runtimeFlags.compositeOpaqueScrollersEnabled = true;
|
|
|
| function hasOpaqueCompositedScrollingContentsLayer(layer) {
|
| if (layer.name == "Scrolling Contents Layer")
|
| @@ -14,35 +18,53 @@ function hasOpaqueCompositedScrollingContentsLayer(layer) {
|
| return false;
|
| }
|
|
|
| +function postChangeTest() {
|
| + var result = "Should have opaque composited scrolling contents layer: ";
|
| + if (hasOpaqueCompositedScrollingContentsLayer(JSON.parse(window.internals.layerTreeAsText(document))))
|
| + result += "Pass.\n";
|
| + else
|
| + result += "Fail.\n";
|
| + document.getElementById("test-2-output").innerHTML = result;
|
| +}
|
| +
|
| 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))))
|
| + var result = "Should not 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);
|
| + document.getElementById("test-1-output").innerHTML = result;
|
| +
|
| + scrollerElement = document.getElementById("scroller");
|
| + scrollerElement.style.background = "green local content-box";
|
| +
|
| + runAfterLayoutAndPaint(postChangeTest(), false);
|
| }
|
| </script>
|
| <style>
|
| #scroller {
|
| - background: white local content-box;
|
| + background: transparent 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>
|
| +</head>
|
| +<body>
|
| <!-- 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>
|
| +<p>Scroller background should be green</p>
|
| +<p id="test-1-output"></p>
|
| +<p id="test-2-output"></p>
|
| +</body></html>
|
|
|