blob: 032c5a7d47fdd1ab58ab188f138a823553191e8a [file] [log] [blame]
<!DOCTYPE html>
<body>
<div id="container" style="display: none;"></div>
<script src="../resources/magnitude-perf.js"></script>
<script>
var container = document.getElementById('container');
function setupFunction(magnitude)
{
container.innerHTML = '';
for (var i = 0; i < magnitude; i++)
container.appendChild(document.createElement('div'));
}
function test(magnitude)
{
var children = container.children;
for (var i = children.length; i > 0;i--)
children[i - 1].class = 'hi';
}
Magnitude.description("Tests that iterating over HTMLCollection backwards is linear.");
Magnitude.run(setupFunction, test, Magnitude.LINEAR);
</script>
</body>
</html>