| <title>Creating composited layers for fixed position elements</title> |
| <style type="text/css" media="screen"> |
| <script type="text/javascript" charset="utf-8"> |
| window.internals.settings.setEnableCompositingForFixedPosition(true); |
| var layerTreeOutput = ''; |
| // If the fixed position element doesn't have its own stacking context then |
| // it cannot get a composited layer. |
| layerTreeOutput += 'Before (should be empty): \n' + testRunner.layerTreeAsText() + '\n'; |
| // Adding a z-index to the fixed position element will give it a stacking context |
| // and allow it to be composited. |
| document.getElementById('fixed').style.zIndex = '1'; |
| layerTreeOutput += 'After (should not be empty): \n' + testRunner.layerTreeAsText(); |
| document.getElementById('layertree').innerText = layerTreeOutput; |
| // Adding a transform to the container will turn off compositing. |
| document.getElementById('container').style.webkitTransform = 'translateX(0)'; |
| layerTreeOutput += 'After (should be empty): \n' + testRunner.layerTreeAsText(); |
| document.getElementById('layertree').innerText = layerTreeOutput; |
| window.addEventListener("load", doTest, false); |
| <!-- Fixed position element should get its own layer --> |
| <pre id="layertree"></pre> |