Merge Chromium + Blink git repositories
[chromium-blink-merge.git] / third_party / WebKit / PerformanceTests / ShadowDOM / DistributionWithMultipleShadowRoots.html
blob4400086e7524138379f8a8abfc6811c6cd688e64
1 <!DOCTYPE html>
2 <html>
3 <head>
4 <script type="text/javascript" src="../resources/runner.js"></script>
5 </head>
6 <body>
8 <div id="wrapper">
9 <div id="host"></div>
10 </div>
12 <script>
13 var numShadowRoots = 20;
14 var numDivsInHost = 10;
15 var nLoops = 300;
17 function setup()
19 var nDivs = numDivsInHost;
21 for (var i = 0; i < nDivs; ++i) {
22 var div = document.createElement('div');
23 div.appendChild(document.createTextNode('div' + i));
24 host.appendChild(div);
27 for (var i = 0; i < numShadowRoots; ++i) {
28 var shadow = document.createElement('shadow');
29 var content = document.createElement('content');
30 shadow.appendChild(content);
31 var shadowRoot = host.createShadowRoot();
32 shadowRoot.appendChild(shadow);
36 function run()
38 var host = document.getElementById('host');
39 var nLoops = window.nLoops;
41 var div = document.createElement('div');
42 for (var i = 0; i < nLoops; ++i) {
43 host.appendChild(div);
44 host.removeChild(div);
45 PerfTestRunner.forceLayoutOrFullFrame();
49 function done()
51 wrapper.innerHTML = '';
55 setup();
57 PerfTestRunner.measureTime({
58 description: "Measure Distribution and Layout time in a case there are multiple ShadowRoots",
59 run: run,
60 done: done
61 });
62 </script>
63 </body>
64 </html>