Merge Chromium + Blink git repositories
[chromium-blink-merge.git] / third_party / WebKit / PerformanceTests / Layout / subtree-detaching.html
blobf705c30eac31f97559bc429797b169b8c882aa4e
1 <!DOCTYPE html>
2 <html>
3 <body>
4 <script src="../resources/runner.js"></script>
5 <script>
6 function buildTree()
8 wrapper = document.createElement("div");
9 for (i = 0; i < 1000; ++i) {
10 var child = document.createElement("div");
11 for (j = 0; j < 1000; ++j) {
12 var grandChild = document.createElement("div");
13 child.appendChild(grandChild);
15 wrapper.appendChild(child);
17 document.body.appendChild(wrapper);
20 function setup() {
21 wrapper.style.display = "block";
22 PerfTestRunner.forceLayoutOrFullFrame();
25 function runTest() {
26 setup();
28 var now = PerfTestRunner.now();
30 wrapper.style.display = "none";
31 PerfTestRunner.forceLayoutOrFullFrame();
33 return PerfTestRunner.now() - now;
36 buildTree();
38 PerfTestRunner.measureTime({run: runTest, description: "This benchmark checks the time spend in detaching an tree." });
39 </script>
40 </body>
41 </html>