<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
        "http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<script src="resources/repaint.js"></script>
<script>
if (window.testRunner)
  testRunner.dumpAsText(true);

function repaintTest()
{
    var canvas = document.getElementById('c1');
    var offset = document.body.offsetLeft; // Forces layout
    canvas.width = canvas.width; // Should wipe canvas clean
}
</script>
</head>
<body onload="runRepaintTest();">
<p><b>BUG ID:</b> <a href="https://bugs.webkit.org/show_bug.cgi?id=43341">Bugzilla bug 43341</a>
Setting canvas width after canvas already rendered resets canvas data appropriately, but doesn't repaint immediately.
<p id="success" style="background-color:palegreen; padding:3px;"><b>TEST PASS:</b> 
The canvas should go blank due to setting on the canvas width.
</p>

<hr>

<p class="output">Actual output: (blank canvas)</p>
<canvas id="c1" class="output" width="100" height="50" ></canvas>

<script>

var canvas = document.getElementById('c1');
var ctx = canvas.getContext('2d');
ctx.fillStyle = '#0f0';
ctx.fillRect(0, 0, 100, 50);

</script>

</body>
</html>
