blob: aa293077cc47a49cbe5c5d514be458924af8cb0f [file] [log] [blame]
<!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 = 256;
var nLoops = 100;
var classNames = ['A', 'B', 'C', 'D', 'E'];
function setup()
{
var nDivs = numDivsInHost;
for (var i = 0; i < nDivs; ++i) {
var div = document.createElement('div');
div.appendChild(document.createTextNode('div' + i));
var names = new Array();
for (var j = 0; j < classNames.length; ++j) {
if (i & (1 << j))
names.push(classNames[j]);
}
div.className = names.join(' ');
host.appendChild(div);
}
var shadowRoot = host.createShadowRoot();
for (var i = 0; i < classNames.length; ++i) {
var content = document.createElement('content');
content.setAttribute('select', '.' + classNames[i]);
shadowRoot.appendChild(content);
}
shadowRoot.appendChild(document.createElement('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 in a case there are multiple InsertionPoints",
run: run,
done: done
});
</script>
</body>
</html>