| <!DOCTYPE html> |
| |
| <html> |
| <head> |
| <style> |
| .fixed { |
| position: fixed; |
| z-index: 1; |
| } |
| |
| .absolute { |
| position: absolute; |
| } |
| |
| .unscrollable { |
| overflow-x: hidden; |
| overflow-y: hidden; |
| } |
| |
| .box { |
| top: 100px; |
| left: 10px; |
| width: 100px; |
| height: 100px; |
| } |
| |
| .bigBox { |
| width: 300px; |
| height: 300px; |
| } |
| |
| .red { |
| background-color: red; |
| } |
| |
| .lime { |
| background-color: lime; |
| } |
| |
| .composited { |
| transform: translatez(0); |
| } |
| |
| .scrollable { |
| border: solid black 1px; |
| overflow: scroll; |
| } |
| </style> |
| |
| <script type="text/javascript"> |
| if (window.internals) |
| window.internals.settings.setPreferCompositingToLCDTextEnabled(true); |
| |
| if (window.testRunner) { |
| testRunner.dumpAsText(); |
| |
| window.addEventListener("load", function() { |
| document.getElementById("layertree").innerText = window.internals.layerTreeAsText(document); |
| }, false); |
| } |
| </script> |
| </head> |
| |
| <body class="unscrollable"> |
| <p>Even though the fixed-position element's container is nonscrollable, it |
| should still be composited because one of its ancestors is scrolling.</p> |
| <pre id="layertree"></pre> |
| |
| <div class="scrollable bigBox"> |
| <div style="height: 800px; background-image: linear-gradient(to bottom,red,orange,yellow, green, blue,indigo,violet);"></div> |
| <div class="fixed lime box"></div> |
| </div> |
| </body> |
| </html> |
| |