Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 1 <!DOCTYPE html> | |
| 2 <style> | |
| 3 #container { | |
| 4 height: 500px; | |
| 5 width: 300px; | |
| 6 overflow: scroll; | |
| 7 } | |
| 8 | |
| 9 .scrolled { | |
| 10 height: 50px; | |
| 11 width: 100px; | |
| 12 background: orange; | |
| 13 margin: 15px; | |
| 14 transform: translateZ(0); | |
| 15 } | |
| 16 </style> | |
| 17 <script> | |
| 18 if (window.testRunner) | |
| 19 testRunner.dumpAsText(); | |
| 20 | |
| 21 if (window.internals) | |
| 22 window.internals.settings.setAcceleratedCompositingForOverflowScrollEnabled( true); | |
| 23 | |
| 24 var iteration = 1; | |
| 25 | |
| 26 function dumpLayerTree() { | |
| 27 var pre = document.getElementById("console"); | |
| 28 | |
| 29 if (window.internals) { | |
| 30 var layerTreeAsText = internals.layerTreeAsText(document); | |
| 31 pre.innerHTML += '\n\n*** iteration ' + iteration + ': ***\n\n'; | |
| 32 pre.innerHTML += layerTreeAsText; | |
| 33 } | |
| 34 | |
| 35 iteration++; | |
| 36 } | |
| 37 | |
| 38 onload = function doTest() | |
|
Ian Vollick
2014/06/05 18:28:41
nit: I don't think this function needs a name.
hartmanng
2014/06/05 20:28:03
Done.
| |
| 39 { | |
| 40 var container = document.getElementById('container'); | |
| 41 container.style.backgroundColor = 'blue'; | |
| 42 | |
| 43 dumpLayerTree(); | |
| 44 | |
| 45 var selection = getSelection(); | |
| 46 var range = document.createRange(); | |
| 47 range.selectNode(document.getElementById("selection")); | |
| 48 selection.addRange(range); | |
| 49 | |
| 50 dumpLayerTree(); | |
| 51 | |
| 52 container.style.backgroundColor = ''; | |
| 53 | |
| 54 dumpLayerTree(); | |
| 55 | |
| 56 selection.removeAllRanges(); | |
| 57 | |
| 58 dumpLayerTree(); | |
| 59 } | |
| 60 </script> | |
| 61 | |
| 62 This test passes if the container's scrolling contents layer (the first child of the GraphicsLayer with 4 children) | |
| 63 draws content only on iterations 1, 2, and 3. | |
| 64 | |
| 65 <div id="container"> | |
| 66 <div class="scrolled">Lorem Ipsum</div> | |
| 67 <div class="scrolled">Lorem Ipsum</div> | |
| 68 <div class="scrolled" id="selection">Lorem Ipsum</div> | |
| 69 <div class="scrolled">Lorem Ipsum</div> | |
| 70 <div class="scrolled">Lorem Ipsum</div> | |
| 71 <div class="scrolled">Lorem Ipsum</div> | |
| 72 <div class="scrolled">Lorem Ipsum</div> | |
| 73 <div class="scrolled">Lorem Ipsum</div> | |
| 74 <div class="scrolled">Lorem Ipsum</div> | |
| 75 <div class="scrolled">Lorem Ipsum</div> | |
| 76 </div> | |
| 77 <pre id="console"></pre> | |
| OLD | NEW |