blob: a7d90e2e8e07da8e8efa4d62e236e4aa3fe28a12 [file] [log] [blame]
<!DOCTYPE html>
<html>
<head>
<title>Performance tester for non-overlaping 2D layers</title>
<style>
.container {
position: relative;
width: 20px;
height: 20px;
border: 1px solid #AAA;
margin: 0 auto 5px;
}
.box {
width: 100%;
height: 100%;
position: absolute;
background: red;
}
.composited {
-webkit-transform: translateZ(1px);
}
</style>
<script src="../resources/runner.js"></script>
</head>
<body>
<pre id="log"></pre>
<script>
function createTestFunction(count) {
return function() {
var container = document.createElement("div");
for(i = 0; i < count; ++i) {
var outer = document.createElement('div');
outer.className = 'container';
var inner = document.createElement('div');
inner.className = 'box';
if (i == 0) {
// Use at least one 3D layer to trigger the overlap map checking.
inner.className += " composited";
}
outer.appendChild(inner);
container.appendChild(outer);
}
document.body.appendChild(container);
// Force a layout update.
document.body.clientHeight;
container.remove();
}
}
PerfTestRunner.measureTime({run: createTestFunction(5000)});
</script>
</body>
</html>