The recursive tail call optimisation is wrong on closures
[WebKit-https.git] / PerformanceTests / Layout / inline-layout-no-text.html
1 <!DOCTYPE html>
2 <html>
3 <head>
4     <title>Test layout performance with inlines and inline-blocks.</title>
5     <script src="../resources/runner.js"></script>
6     <style>
7         .inlineBlock { display:inline-block; width:10px; height:10px; }
8     </style>
9 </head>
10 <body>
11     <pre id="log"></pre>
12     <div id="target" style="width: 300px; height: 0px; display: block;">
13     </div>
14     <script>
15         var style = target.style;
16
17         for (var i = 0; i < 40000; i++) {
18             const span = document.createElement("span");
19             const div = document.createElement("div");
20             div.classList.add("inlineBlock");
21             span.appendChild(div);
22             target.appendChild(span);
23         }
24
25         function test() {
26             style.width = "280px";
27             target.offsetLeft;
28             style.width = "300px";
29             target.offsetLeft;
30             style.width = "290px";
31             target.offsetLeft;
32         }
33
34         PerfTestRunner.measureRunsPerSecond({ run: test });
35     </script>
36 </body>
37 </html>