| <!DOCTYPE html> |
| <html> |
| <head> |
| <title>Test of very large layer resizing with layer children</title> |
| |
| <style type="text/css" media="screen"> |
| |
| #container { |
| width: 500px; |
| height: 500px; |
| border: 1px solid black; |
| background-color: yellow; |
| -webkit-transform:translateZ(0); |
| } |
| |
| .box { |
| position: absolute; |
| left:50px; |
| width: 200px; |
| height: 200px; |
| -webkit-transform:translateZ(0); |
| } |
| |
| .at-the-top { |
| top: 100px; |
| background-color: red; |
| } |
| |
| .at-the-bottom { |
| top:200px; |
| left: 275px; |
| background-color: blue; |
| } |
| </style> |
| <script type="text/javascript" charset="utf-8"> |
| if (window.layoutTestController) { |
| layoutTestController.dumpAsText(); |
| layoutTestController.waitUntilDone(); |
| } |
| |
| result = ""; |
| |
| function testOnLoad() |
| { |
| // Small layer first |
| window.setTimeout(function() { |
| if (window.layoutTestController) |
| result = "First (small layer):<br>" + layoutTestController.layerTreeAsText(); |
| }, 0); |
| |
| // Huge layer second |
| window.setTimeout(function() { |
| document.getElementById('container').style.height = "5000px"; |
| document.getElementById('blue-box').style.top = "4700px"; |
| |
| // Let it render |
| window.setTimeout(function() { |
| if (window.layoutTestController) |
| result += "<br><br>Second (huge layer):<br>" + layoutTestController.layerTreeAsText(); |
| }, 0); |
| }, 100); |
| |
| // Small layer third |
| window.setTimeout(function() { |
| document.getElementById('container').style.height = "500px"; |
| document.getElementById('blue-box').style.top = "200px"; |
| |
| // Let it render |
| window.setTimeout(function() { |
| if (window.layoutTestController) { |
| result += "<br><br>Third (small layer):<br>" + layoutTestController.layerTreeAsText(); |
| document.getElementById('layers').innerHTML = result; |
| layoutTestController.notifyDone(); |
| } |
| }, 0); |
| }, 200); |
| } |
| |
| window.addEventListener('load', testOnLoad, false); |
| </script> |
| </head> |
| <body> |
| <p> |
| The yellow box should be 500 x 500 on startup. Then it should |
| stretch to be 500 x 5000, then shrink back down to 500 x 500. |
| This tests that we can resize to a huge layer and back again |
| and still maintain integrity of the layer tree. |
| </p> |
| <div id="container"> |
| <div class="box at-the-top"></div> |
| <div id="blue-box" class="box at-the-bottom"></div> |
| </div> |
| <pre id="layers">Layer tree appears here in DRT.</pre> |
| </body> |
| </html> |