| OLD | NEW |
| 1 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" | 1 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" |
| 2 "http://www.w3.org/TR/html4/strict.dtd"> | 2 "http://www.w3.org/TR/html4/strict.dtd"> |
| 3 <html> | 3 <html> |
| 4 <head> | 4 <head> |
| 5 <script src="resources/repaint.js"></script> | 5 <script src="../../resources/run-after-display.js"></script> |
| 6 <script> | 6 <script> |
| 7 if (window.testRunner) | 7 if (window.testRunner) { |
| 8 testRunner.dumpAsTextWithPixelResults(); | 8 testRunner.dumpAsTextWithPixelResults(); |
| 9 testRunner.waitUntilDone(); |
| 10 } |
| 9 | 11 |
| 10 function repaintTest() | 12 function repaintTest() |
| 11 { | 13 { |
| 12 var canvas = document.getElementById('c1'); | 14 var canvas = document.getElementById('c1'); |
| 13 var offset = document.body.offsetLeft; // Forces layout | 15 var offset = document.body.offsetLeft; // Forces layout |
| 14 canvas.width = canvas.width; // Should wipe canvas clean | 16 canvas.width = canvas.width; // Should wipe canvas clean |
| 17 if (window.testRunner) |
| 18 testRunner.notifyDone(); |
| 15 } | 19 } |
| 16 </script> | 20 </script> |
| 17 </head> | 21 </head> |
| 18 <body onload="runRepaintTest();"> | 22 <body onload="runAfterDisplay(repaintTest);"> |
| 19 <p><b>BUG ID:</b> <a href="https://bugs.webkit.org/show_bug.cgi?id=43341">Bugzil
la bug 43341</a> | 23 <p><b>BUG ID:</b> <a href="https://bugs.webkit.org/show_bug.cgi?id=43341">Bugzil
la bug 43341</a> |
| 20 Setting canvas width after canvas already rendered resets canvas data appropriat
ely, but doesn't repaint immediately. | 24 Setting canvas width after canvas already rendered resets canvas data appropriat
ely, but doesn't repaint immediately. |
| 21 <p id="success" style="background-color:palegreen; padding:3px;"><b>TEST PASS:</
b> | 25 <p id="success" style="background-color:palegreen; padding:3px;"><b>TEST PASS:</
b> |
| 22 The canvas should go blank due to setting on the canvas width. | 26 The canvas should go blank due to setting on the canvas width. |
| 23 </p> | 27 </p> |
| 24 | 28 |
| 25 <hr> | 29 <hr> |
| 26 | 30 |
| 27 <p class="output">Actual output: (blank canvas)</p> | 31 <p class="output">Actual output: (blank canvas)</p> |
| 28 <canvas id="c1" class="output" width="100" height="50" ></canvas> | 32 <canvas id="c1" class="output" width="100" height="50" ></canvas> |
| 29 | 33 |
| 30 <script> | 34 <script> |
| 31 | 35 |
| 32 var canvas = document.getElementById('c1'); | 36 var canvas = document.getElementById('c1'); |
| 33 var ctx = canvas.getContext('2d'); | 37 var ctx = canvas.getContext('2d'); |
| 34 ctx.fillStyle = '#0f0'; | 38 ctx.fillStyle = '#0f0'; |
| 35 ctx.fillRect(0, 0, 100, 50); | 39 ctx.fillRect(0, 0, 100, 50); |
| 36 | 40 |
| 37 </script> | 41 </script> |
| 38 | 42 |
| 39 </body> | 43 </body> |
| 40 </html> | 44 </html> |
| OLD | NEW |