2 .hidden { display: none; }
4 <script src="../resources/magnitude-perf.js"></script>
9 function setupFunction(magnitude)
12 for (var i = 0; i < magnitude; ++i)
13 html += '<tr><td>A</td><td>B</td><td>C</td><td>D</td><td>E</td><td>F</td></tr>\n';
15 document.querySelector('div').innerHTML = html;
18 function forEachRow(what)
20 Array.prototype.forEach.call(document.querySelectorAll("tr"), what);
23 function test(magnitude)
25 forEachRow(function(tr) {
26 tr.className = 'hidden';
28 document.body.offsetWidth;
29 forEachRow(function(tr) {
32 document.body.offsetWidth;
35 Magnitude.description("Tests that hiding/showing of table rows is linear.");
36 Magnitude.run(setupFunction, test, Magnitude.LINEAR);
37 document.querySelector('div').textContent = '';