| <!DOCTYPE html> |
| <body> |
| <script src="../resources/runner.js"></script> |
| <script src="resources/paint.js"></script> |
| <style>td { border: 1px solid blue; font-size: 3px; }</style> |
| <script> |
| function createTable(rows, columns) { |
| var table = document.createElement("TABLE"); |
| // Collapsing border is not necessary to see the slowness |
| // but it makes the painting phase ~2x slower. |
| table.style.borderCollapse = "collapse"; |
| for (var i = 0; i < rows; ++i) { |
| var tr = document.createElement("TR"); |
| for (var j = 0; j < columns; ++j) { |
| var td = document.createElement("TD"); |
| td.appendChild(document.createTextNode("ABC")); |
| tr.appendChild(td); |
| } |
| table.appendChild(tr); |
| } |
| return table; |
| } |
| |
| var table = createTable(300, 320); |
| document.body.appendChild(table); |
| |
| var ix = 30; |
| var iy = 30; |
| |
| measurePaint({ |
| run: function() { |
| table.childNodes[iy].childNodes[ix].style.borderColor = "red"; |
| ix++; |
| iy++; |
| }, |
| }); |
| </script> |
| </body> |