Chromium Code Reviews| 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-background-transparent-to-opaque.html b/third_party/WebKit/LayoutTests/compositing/overflow/overflow-scroll-background-transparent-to-opaque.html |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..7fd66a0a27fd3a152b5280dfd2add270ca631ac0 |
| --- /dev/null |
| +++ b/third_party/WebKit/LayoutTests/compositing/overflow/overflow-scroll-background-transparent-to-opaque.html |
| @@ -0,0 +1,74 @@ |
| +<!DOCTYPE html> |
| +<html> |
| +<head> |
| +<script src="../../resources/run-after-layout-and-paint.js"></script> |
| +<script> |
| + if (window.internals) |
| + internals.runtimeFlags.compositeOpaqueScrollersEnabled = true; |
| + |
| + if (window.testRunner) { |
| + testRunner.dumpAsTextWithPixelResults(); |
| + testRunner.waitUntilDone(); |
| + } |
| + |
| + 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 = "Should not have opaque composited scrolling contents layer: "; |
| + if (!hasOpaqueCompositedScrollingContentsLayer(JSON.parse(window.internals.layerTreeAsText(document)))) |
|
flackr
2016/08/30 21:14:49
Same as above, check that we don't have a composit
Stephen Chennney
2016/08/31 20:50:20
Done.
|
| + result += "Pass.\n"; |
| + else |
| + result += "Fail.\n"; |
| + document.getElementById("test-1-output").innerHTML = result; |
| + |
| + scrollerElement = document.getElementById("scroller"); |
| + scrollerElement.style.background = "green local content-box"; |
| + |
| + runAfterLayoutAndPaint(function() { |
| + 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; |
| + runAfterLayoutAndPaint(function() { testRunner.notifyDone(); }); |
| + }); |
| + } |
| +</script> |
| +<style> |
| +#scroller { |
| + background: transparent local content-box; |
| + border: 10px solid rgba(0, 255, 0, 0.5); |
| + overflow: scroll; |
| + width: 200px; |
| + height: 200px; |
| +} |
| +.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. |
|
flackr
2016/08/30 21:14:49
Comment also seems out of date.
Stephen Chennney
2016/08/31 20:50:20
Done.
|
| +--> |
| +<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> |