blob: 6d227037f1124948706d04f3c66ab9a7b9ed58ae [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 = 10;
var nLoops = 3000;
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);
}
var content = document.createElement('content');
var shadowRoot = host.webkitCreateShadowRoot();
shadowRoot.appendChild(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 (with a few host children)",
run: run,
done: done
});
</script>
</body>
</html>