Merge Chromium + Blink git repositories
[chromium-blink-merge.git] / third_party / WebKit / PerformanceTests / ShadowDOM / MultipleInsertionPoints.html
blob17a633defa093585cc6f7db2a26e2bfa796aa91e
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 numDivsInHost = 256;
14 var nLoops = 100;
15 var classNames = ['A', 'B', 'C', 'D', 'E'];
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));
25 var names = new Array();
26 for (var j = 0; j < classNames.length; ++j) {
27 if (i & (1 << j))
28 names.push(classNames[j]);
30 div.className = names.join(' ');
32 host.appendChild(div);
35 var shadowRoot = host.createShadowRoot();
36 for (var i = 0; i < classNames.length; ++i) {
37 var content = document.createElement('content');
38 content.setAttribute('select', '.' + classNames[i]);
39 shadowRoot.appendChild(content);
41 shadowRoot.appendChild(document.createElement('content'));
44 function run()
46 var host = document.getElementById('host');
47 var nLoops = window.nLoops;
49 var div = document.createElement('div');
50 for (var i = 0; i < nLoops; ++i) {
51 host.appendChild(div);
52 host.removeChild(div);
53 PerfTestRunner.forceLayoutOrFullFrame();
57 function done()
59 wrapper.innerHTML = '';
63 setup();
65 PerfTestRunner.measureTime({
66 description: "Measure Distribution and Layout time in a case there are multiple InsertionPoints",
67 run: run,
68 done: done
69 });
70 </script>
71 </body>
72 </html>