<!DOCTYPE html>
<html>
<head>
<script src="../resources/runner.js"></script>
<style>
  [attr=root] [attr=child] {}
</style>
</head>
<body>
<div id="root"></div>
<script>
function addChildren(element, numChildren, idPrefix)
{
    for (var i = 0; i < numChildren; i++) {
        var child = document.createElement("div");
        child.id = idPrefix  + i;
        element.appendChild(child);
    }
}

function makeTree(element, depth, fanOut, idPrefix)
{
    if (depth <= 0)
        return;
    addChildren(element, fanOut, idPrefix);
    for (var child = element.firstChild; child.nextSibling; child = child.nextSibling) {
        makeTree(child, depth - 1, fanOut, child.id);
    }
    if (child)
        makeTree(child, depth - 1, fanOut, child.id);
}

var root = document.querySelector("#root");
makeTree(root, 6, 5, "child");

var child = document.querySelector("#child012341");
child.setAttribute("attr", "child");
var runFunction = function()
{
    root.offsetHeight; // force recalc style
    root.setAttribute("attr" , "root");
    root.offsetHeight;
    root.removeAttribute("attr");
}

PerfTestRunner.measureRunsPerSecond({run: runFunction});

</script>
</body>
</html>

Add a performance test for attribute descendant selectors.
Add a performance test for attribute descendant selectors.

BUG=352300
NOTRY=true

Review URL: https://codereview.chromium.org/199543004

git-svn-id: bf5cd6ccde378db821296732a091cfbcf5285fbd@169671 bbb929c8-8fbe-4397-9dbb-9b2b20218538
