Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 1 (function() { | |
| 2 function createElement(tag, parent, className, id) { | |
| 3 var el = document.createElement(tag); | |
| 4 el.className = className; | |
| 5 if (id) | |
| 6 el.id = id; | |
| 7 parent.appendChild(el); | |
| 8 return el; | |
| 9 } | |
| 10 | |
| 11 function createTable(width, height) { | |
| 12 var table = createElement("table", document.body, "table"); | |
| 13 for (var y = 0; y < height; ++y) { | |
| 14 var tr = createElement("tr", table, "tr"); | |
| 15 for (var x = 0; x < width; ++x) { | |
| 16 var td = createElement("td", tr, "td"); | |
| 17 if (x==10 && y==0) | |
| 18 table.rows[y].cells[x].colSpan = "50"; | |
| 19 } | |
| 20 } | |
| 21 return table; | |
| 22 } | |
| 23 | |
| 24 function createTestFunction(width, height) { | |
| 25 return function() { | |
| 26 var table = createTable(width, height); | |
| 27 table.clientHeight; | |
| 28 } | |
| 29 } | |
|
Julien - ping for review
2014/02/12 23:05:46
It really seems like this code could be shared amo
| |
| 30 | |
| 31 window.createTableTestFunction = createTestFunction; | |
| 32 })(); | |
| OLD | NEW |