| OLD | NEW |
| 1 <!doctype HTML> |
| 2 <script src="resources/composited-scroll.js"></script> |
| 1 <script> | 3 <script> |
| 2 if (window.testRunner) | 4 if (window.testRunner) |
| 3 testRunner.dumpAsText(); | 5 testRunner.dumpAsText(); |
| 4 | 6 |
| 5 if (window.internals) | 7 if (window.internals) |
| 6 internals.runtimeFlags.compositeOpaqueScrollersEnabled = true; | 8 internals.runtimeFlags.compositeOpaqueScrollersEnabled = true; |
| 7 | 9 |
| 8 function hasOpaqueCompositedScrollingContentsLayer(layer) { | |
| 9 if (layer.name == "Scrolling Contents Layer") | |
| 10 return layer.contentsOpaque; | |
| 11 if (layer.children) { | |
| 12 for (var i = 0; i < layer.children.length; i++) { | |
| 13 if (hasOpaqueCompositedScrollingContentsLayer(layer.children[i])) | |
| 14 return true; | |
| 15 } | |
| 16 } | |
| 17 return false; | |
| 18 } | |
| 19 | |
| 20 onload = function() { | 10 onload = function() { |
| 21 if (!window.testRunner || !window.internals) | 11 if (!window.testRunner || !window.internals) |
| 22 return; | 12 return; |
| 23 | 13 |
| 24 var result = ""; | 14 var result = ""; |
| 25 result += "Should have opaque composited scrolling contents layer: "; | 15 result += "Should have opaque composited scrolling contents layer: "; |
| 26 if (hasOpaqueCompositedScrollingContentsLayer(JSON.parse(window.internals.la
yerTreeAsText(document)))) | 16 if (hasOpaqueCompositedScrollingContentsLayer(JSON.parse(window.internals.la
yerTreeAsText(document)))) |
| 27 result += "Pass.\n"; | 17 result += "Pass.\n"; |
| 28 else | 18 else |
| 29 result += "Fail.\n"; | 19 result += "Fail.\n"; |
| (...skipping 11 matching lines...) Expand all Loading... |
| 41 .spacer { | 31 .spacer { |
| 42 height: 300px; | 32 height: 300px; |
| 43 } | 33 } |
| 44 </style> | 34 </style> |
| 45 <!-- The scroller's Scrolling Contents Layer should be opaque due to the opaque | 35 <!-- The scroller's Scrolling Contents Layer should be opaque due to the opaque |
| 46 color background. Even though the background has a content-box clip there | 36 color background. Even though the background has a content-box clip there |
| 47 is no gap because the scroller has no padding. This means that we will be | 37 is no gap because the scroller has no padding. This means that we will be |
| 48 able to draw text with subpixel anti-aliasing. | 38 able to draw text with subpixel anti-aliasing. |
| 49 --> | 39 --> |
| 50 <div id="scroller"><div class="spacer"></div></div> | 40 <div id="scroller"><div class="spacer"></div></div> |
| OLD | NEW |