| <!DOCTYPE html> |
| <html> |
| <head> |
| <script type="text/javascript" src="../resources/runner.js"></script> |
| </head> |
| <body> |
| |
| <div id="wrapper"> |
| <div id="host"></div> |
| </div> |
| |
| <script> |
| var numDivsInHost = 10; |
| var nLoops = 3000; |
| |
| function setup() |
| { |
| var nDivs = numDivsInHost; |
| |
| for (var i = 0; i < nDivs; ++i) { |
| var div = document.createElement('div'); |
| div.appendChild(document.createTextNode('div' + i)); |
| host.appendChild(div); |
| } |
| |
| var content = document.createElement('content'); |
| var shadowRoot = host.createShadowRoot(); |
| shadowRoot.appendChild(content); |
| } |
| |
| function run() |
| { |
| var host = document.getElementById('host'); |
| var nLoops = window.nLoops; |
| |
| var div = document.createElement('div'); |
| for (var i = 0; i < nLoops; ++i) { |
| host.appendChild(div); |
| host.removeChild(div); |
| PerfTestRunner.forceLayout(); |
| } |
| } |
| |
| function done() |
| { |
| wrapper.innerHTML = ''; |
| } |
| |
| |
| setup(); |
| |
| PerfTestRunner.measureTime({ |
| description: "Measure Distribution and Layout time (with a few host children)", |
| run: run, |
| done: done |
| }); |
| </script> |
| </body> |
| </html> |