1 <!DOCTYPE HTML PUBLIC
"-//W3C//DTD HTML 4.01//EN"
2 "http://www.w3.org/TR/html4/strict.dtd">
5 <script src=
"../../resources/run-after-layout-and-paint.js"></script>
7 if (window
.testRunner
) {
8 testRunner
.dumpAsTextWithPixelResults();
9 testRunner
.waitUntilDone();
12 function repaintTest()
14 var canvas
= document
.getElementById('c1');
15 var offset
= document
.body
.offsetLeft
; // Forces layout
16 canvas
.width
= canvas
.width
; // Should wipe canvas clean
17 if (window
.testRunner
)
18 testRunner
.notifyDone();
22 <body onload=
"runAfterLayoutAndPaint(repaintTest);">
23 <p><b>BUG ID:
</b> <a href=
"https://bugs.webkit.org/show_bug.cgi?id=43341">Bugzilla bug
43341</a>
24 Setting canvas width after canvas already rendered resets canvas data appropriately, but doesn't repaint immediately.
25 <p id=
"success" style=
"background-color:palegreen; padding:3px;"><b>TEST PASS:
</b>
26 The canvas should go blank due to setting on the canvas width.
31 <p class=
"output">Actual output: (blank canvas)
</p>
32 <canvas id=
"c1" class=
"output" width=
"100" height=
"50" ></canvas>
36 var canvas
= document
.getElementById('c1');
37 var ctx
= canvas
.getContext('2d');
38 ctx
.fillStyle
= '#0f0';
39 ctx
.fillRect(0, 0, 100, 50);