blob: bd669d5638ae8adf0d64687e96142c79273f96c3 [file] [log] [blame]
<!DOCTYPE html>
<body>
<script src="../resources/runner.js"></script>
<script src="resources/paint.js"></script>
<style>td { border: 1px solid blue }</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");
tr.appendChild(td);
}
table.appendChild(tr);
}
return table;
}
var table = createTable(240, 220);
table.style.border = '2px solid green';
document.body.appendChild(table);
measurePaint({
run: function() {
table.style.borderColor = table.style.borderColor == 'green' ?
'yellow' : 'green';
},
});
</script>
</body>