OLD | NEW |
(Empty) | |
| 1 <script> |
| 2 if (window.testRunner) |
| 3 window.testRunner.dumpAsText(); |
| 4 |
| 5 function hasNotOpaqueCompositedScrollingContentsLayer(layer) { |
| 6 if (layer.name == "Scrolling Contents Layer") |
| 7 return !layer.contentsOpaque; |
| 8 if (layer.children) { |
| 9 for (var i = 0; i < layer.children.length; i++) { |
| 10 if (hasNotOpaqueCompositedScrollingContentsLayer(layer.children[i])) |
| 11 return true; |
| 12 } |
| 13 } |
| 14 return false; |
| 15 } |
| 16 |
| 17 onload = function() { |
| 18 if (!window.testRunner || !window.internals) |
| 19 return; |
| 20 |
| 21 var result = ""; |
| 22 result += "Should not have opaque composited scrolling contents layer: "; |
| 23 if (hasNotOpaqueCompositedScrollingContentsLayer(JSON.parse(window.internals
.layerTreeAsText(document)))) |
| 24 result += "Pass.\n"; |
| 25 else |
| 26 result += "Fail.\n"; |
| 27 window.testRunner.setCustomTextOutput(result); |
| 28 } |
| 29 </script> |
| 30 <style> |
| 31 #scroller { |
| 32 background: white local content-box; |
| 33 border: 10px solid rgba(0, 255, 0, 0.5); |
| 34 overflow: scroll; |
| 35 padding: 10px; |
| 36 width: 180px; |
| 37 height: 180px; |
| 38 will-change: transform; |
| 39 } |
| 40 .spacer { |
| 41 height: 280px; |
| 42 } |
| 43 </style> |
| 44 <!-- The scroller's Scrolling Contents Layer should be transparent due to the |
| 45 content-box clip with a 10px padding leaving a transparent gap between. |
| 46 --> |
| 47 <div id="scroller"><div class="spacer"></div></div> |
| 48 <pre id="layertree"></pre> |
OLD | NEW |