4 <script type=
"text/javascript" src=
"../resources/runner.js"></script>
13 var numDivsInHost
= 100;
14 var array
= new Array(numDivsInHost
);
18 var nDivs
= numDivsInHost
;
20 window
.shadowRoot
= host
.createShadowRoot();
21 shadowRoot
.innerHTML
= '<h2>Selected</h2><div id="selected"><content select=".selected"></content></div><h2>NonSelected</h2><div id="nonselected"><content></content></div>';
23 for (var i
= 0; i
< nDivs
; ++i
) {
24 var div
= document
.createElement('div');
25 div
.appendChild(document
.createTextNode('div' + i
));
26 host
.appendChild(div
);
33 var nDivs
= numDivsInHost
;
34 var array
= window
.array
;
36 var selected
= shadowRoot
.getElementById('selected');
37 var nonSelected
= shadowRoot
.getElementById('nonselected');
39 for (var i
= 2; i
< 100; ++i
) {
40 for (var j
= 0; j
< nDivs
; ++j
)
41 array
[j
].className
= (j
% i
== 0) ? 'selected' : '';
42 PerfTestRunner
.forceLayoutOrFullFrame();
48 wrapper
.innerHTML
= '';
54 PerfTestRunner
.measureTime({
55 description
: "Measure distribution and layout performance when className is changed",