| <!DOCTYPE html> |
| |
| <html> |
| <head> |
| <style> |
| .container { |
| height: 150px; |
| width: 150px; |
| float: left; |
| position: relative; |
| border: 1px solid black; |
| padding: 20px; |
| margin: 10px; |
| box-sizing: border-box; |
| box-shadow: 0 0 4px rgba(0, 0, 0, 0.2); |
| } |
| |
| .container div { |
| border: 1px solid rgba(0, 0, 0, 0.5); |
| padding: 2px; |
| } |
| |
| .inner { |
| float: left; |
| } |
| |
| .composited { |
| will-change: transform; |
| } |
| |
| .antialiased { |
| -webkit-font-smoothing: antialiased; |
| } |
| </style> |
| <script> |
| if (window.testRunner) |
| testRunner.dumpAsText(); |
| |
| if (window.internals) { |
| internals.setFontSmoothingEnabled(true); |
| internals.settings.setSubpixelAntialiasedLayerTextEnabled(true) |
| } |
| |
| function createContainer(maxDepth, leafSiblings) |
| { |
| var container = document.createElement('div'); |
| container.className = 'composited antialiased container'; |
| |
| var parent = container; |
| |
| for (var depth = 0; depth < maxDepth; ++depth) { |
| var innerDiv = document.createElement('div'); |
| parent.appendChild(innerDiv); |
| parent = innerDiv; |
| } |
| |
| for (var breadth = 0; breadth < leafSiblings; ++breadth) { |
| var child = document.createElement('div'); |
| child.className = 'inner'; |
| child.textContent = breadth; |
| parent.appendChild(child); |
| } |
| |
| return container; |
| } |
| |
| function createContainers() |
| { |
| document.body.appendChild(createContainer(1, 99)); |
| document.body.appendChild(createContainer(1, 100)); |
| document.body.appendChild(createContainer(198, 1)); |
| document.body.appendChild(createContainer(200, 1)); |
| } |
| |
| function doTest() |
| { |
| createContainers(); |
| |
| if (window.internals) |
| document.getElementById('layers').innerText = internals.layerTreeAsText(document); |
| } |
| |
| window.addEventListener('load', doTest, false); |
| </script> |
| </head> |
| <body> |
| |
| <pre id="layers"></pre> |
| |
| </body> |
| </html> |