4 <script type=
"text/javascript" src=
"../resources/runner.js"></script>
10 <div id=
"selected"></div>
12 <div id=
"nonselected"></div>
16 var numDivsInHost
= 100;
17 var typeNames
= ['A', 'B', 'C'];
18 var array
= new Array(numDivsInHost
);
22 var nDivs
= numDivsInHost
;
23 var nonSelected
= document
.getElementById('nonselected');
25 for (var i
= 0; i
< nDivs
; ++i
) {
26 var div
= document
.createElement('div');
27 div
.appendChild(document
.createTextNode('div' + i
));
28 div
.className
= typeNames
[i
% typeNames
.length
]
30 nonSelected
.appendChild(div
);
36 var nDivs
= numDivsInHost
;
37 var array
= window
.array
;
39 var selected
= document
.getElementById('selected');
40 var nonSelected
= document
.getElementById('nonselected');
42 for (var i
= 0; i
< 100; ++i
) {
43 for (var j
= 0; j
< typeNames
.length
; ++j
) {
44 for (var k
= 0; k
< nDivs
; ++k
) {
45 if (array
[k
].className
== typeNames
[j
])
46 selected
.appendChild(array
[k
]);
48 nonSelected
.appendChild(array
[k
]);
50 PerfTestRunner
.forceLayoutOrFullFrame();
57 wrapper
.innerHTML
= '';
62 PerfTestRunner
.measureTime({
63 description
: "Measure distribution and layout performance when we do the almost same thing as select attribute of content element is changed using JavaScript",