OLD | NEW |
---|---|
(Empty) | |
1 <!DOCTYPE html> | |
2 <body> | |
3 <script src="../resources/runner.js"></script> | |
4 <style>td { border: 1px solid blue }</style> | |
5 <script> | |
6 function createTable(rows, columns) { | |
7 var table = document.createElement("TABLE"); | |
8 // Collapsing border is not necessary to see the slowness | |
9 // but it makes the painting phase ~2x slower. | |
10 table.style.borderCollapse = "collapse"; | |
11 for (var i = 0; i < rows; ++i) { | |
12 var tr = document.createElement("TR"); | |
13 for (var j = 0; j < columns; ++j) { | |
14 var td = document.createElement("TD"); | |
15 tr.appendChild(td); | |
16 } | |
17 table.appendChild(tr); | |
18 } | |
19 return table; | |
20 } | |
21 | |
22 var table = createTable(400, 400); | |
23 document.body.appendChild(table); | |
24 | |
25 var y = 0; | |
26 PerfTestRunner.measureFrameTime({ | |
27 run: function() { | |
pdr.
2017/04/27 05:18:56
Optional: can you move the setup into setup() and
Xianzhu
2017/04/27 05:56:00
Good idea! I will address this in a follow-up, inc
| |
28 table.childNodes[y].style.height = '20px'; | |
29 y++; | |
30 }, | |
31 }); | |
32 </script> | |
33 </body> | |
OLD | NEW |