blob: 51f4e829d6bb5ead19d7bad5644636066ff4a8f5 [file] [log] [blame]
<!DOCTYPE html>
<html>
<body>
<script src="../resources/runner.js"></script>
<script>
var parentDiv = document.body;
for (var i = 0; i < 100; i++) {
var div = document.createElement("div");
div.id = "foo" + i;
div.className = "bar" + i;
parentDiv.appendChild(div);
parentDiv = div;
}
var h1 = document.createElement("h1");
h1.id = "id";
h1.className = "class";
parentDiv.appendChild(h1);
PerfTestRunner.measureRunsPerSecond({
description: "This benchmark tests querySelector() for an element that appears in the depths in the document, and is a descendant of an element with a given id",
run: function() {
for (var i = 0; i < 100; i++) {
var res = document.querySelector("#foo98 h1");
}
}});
</script>
</body>
</html>