blob: ba98fbce734cb2e2212ddcfabbe62284c72c1a51 [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 = 1000;
var nLoops = 30;
function setup()
{
var nDivs = numDivsInHost;
for (var i = 0; i < nDivs; ++i) {
var div = document.createElement('div');
div.appendChild(document.createTextNode('div' + i));
host.appendChild(div);
}
window.content = document.createElement('content');
var shadowRoot = host.webkitCreateShadowRoot();
shadowRoot.appendChild(content);
}
function run()
{
var host = document.getElementById('host');
var content = window.content;
var nLoops = window.nLoops;
var div = document.createElement('div');
for (var i = 0; i < nLoops; ++i) {
host.appendChild(div);
host.removeChild(div);
content.getDistributedNodes();
}
}
function done()
{
wrapper.innerHTML = '';
}
setup();
PerfTestRunner.measureRunsPerSecond({
description: "Measure Distribution and Layout time (with a lot of host children)",
run: run,
done: done
});
</script>
</body>
</html>