summaryrefslogtreecommitdiffstats
path: root/third_party/webkit/PerformanceTests/StyleBench/resources/style-bench.html
blob: ce55e10e3b976cc97dd662551a9b94332efc0519 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
<!doctype html>
<script src="style-bench.js"></script>
<body>
<div id="testroot"></div>
<div id="controls">
<select></select>
<button onclick="createBenchmarkFromSelect()">Initialize</button>
<button onclick="createBenchmarkFromSelect().runForever()">Initialize and run</button>
</div>
<script>
const configurations = StyleBench.predefinedConfigurations();

const select = document.querySelector("#controls select");
for (const configuration of configurations) {
    const option = document.createElement("option");
    option.innerHTML = configuration.name;
    select.appendChild(option);
}

function createBenchmark(configuration)
{
    controls.remove();

    return new StyleBench(configuration);
}

function createBenchmarkFromSelect()
{
    return createBenchmark(configurations[select.selectedIndex]);
}
</script>