blob: bc683d000688db8026dea9ec1af5ce09786e9c2e [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.webkitCreateShadowRoot();
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);
host.offsetLeft;
}
}
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>