Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 1 <!DOCTYPE html> | |
| 2 <html> | |
| 3 <head> | |
| 4 <script src="../../resources/run-after-layout-and-paint.js"></script> | |
| 5 <script> | |
| 6 if (window.internals) | |
| 7 internals.runtimeFlags.compositeOpaqueScrollersEnabled = true; | |
| 8 | |
| 9 if (window.testRunner) { | |
| 10 testRunner.dumpAsTextWithPixelResults(); | |
| 11 testRunner.waitUntilDone(); | |
| 12 } | |
| 13 | |
| 14 function hasOpaqueCompositedScrollingContentsLayer(layer) { | |
| 15 if (layer.name == "Scrolling Contents Layer") | |
| 16 return layer.contentsOpaque; | |
| 17 if (layer.children) { | |
| 18 for (var i = 0; i < layer.children.length; i++) { | |
| 19 if (hasOpaqueCompositedScrollingContentsLayer(layer.children[i]) ) | |
| 20 return true; | |
| 21 } | |
| 22 } | |
| 23 return false; | |
| 24 } | |
| 25 | |
| 26 onload = function() { | |
| 27 if (!window.testRunner || !window.internals) | |
| 28 return; | |
| 29 | |
| 30 var result = "Should not have opaque composited scrolling contents layer : "; | |
| 31 if (!hasOpaqueCompositedScrollingContentsLayer(JSON.parse(window.interna ls.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.
| |
| 32 result += "Pass.\n"; | |
| 33 else | |
| 34 result += "Fail.\n"; | |
| 35 document.getElementById("test-1-output").innerHTML = result; | |
| 36 | |
| 37 scrollerElement = document.getElementById("scroller"); | |
| 38 scrollerElement.style.background = "green local content-box"; | |
| 39 | |
| 40 runAfterLayoutAndPaint(function() { | |
| 41 var result = "Should have opaque composited scrolling contents layer : "; | |
| 42 if (hasOpaqueCompositedScrollingContentsLayer(JSON.parse(window.inte rnals.layerTreeAsText(document)))) | |
| 43 result += "Pass.\n"; | |
| 44 else | |
| 45 result += "Fail.\n"; | |
| 46 document.getElementById("test-2-output").innerHTML = result; | |
| 47 runAfterLayoutAndPaint(function() { testRunner.notifyDone(); }); | |
| 48 }); | |
| 49 } | |
| 50 </script> | |
| 51 <style> | |
| 52 #scroller { | |
| 53 background: transparent local content-box; | |
| 54 border: 10px solid rgba(0, 255, 0, 0.5); | |
| 55 overflow: scroll; | |
| 56 width: 200px; | |
| 57 height: 200px; | |
| 58 } | |
| 59 .spacer { | |
| 60 height: 300px; | |
| 61 } | |
| 62 </style> | |
| 63 </head> | |
| 64 <body> | |
| 65 <!-- The scroller's Scrolling Contents Layer should be opaque due to the opaque | |
| 66 color background. Even though the background has a content-box clip there | |
| 67 is no gap because the scroller has no padding. This means that we will be | |
| 68 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.
| |
| 69 --> | |
| 70 <div id="scroller"><div class="spacer"></div></div> | |
| 71 <p>Scroller background should be green</p> | |
| 72 <p id="test-1-output"></p> | |
| 73 <p id="test-2-output"></p> | |
| 74 </body></html> | |
| OLD | NEW |