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