| OLD | NEW |
| 1 <!DOCTYPE html> | 1 <!DOCTYPE html> |
| 2 <!-- Check that resizing a (potentially accelerated) canvas properly clears its | 2 <!-- Check that resizing a (potentially accelerated) canvas properly clears its |
| 3 contents even if the layout size of the canvas does not change. Expected | 3 contents even if the layout size of the canvas does not change. Expected |
| 4 output is a blank canvas. | 4 output is a blank canvas. |
| 5 https://bugs.webkit.org/show_bug.cgi?id=80871 --> | 5 https://bugs.webkit.org/show_bug.cgi?id=80871 --> |
| 6 <html> | 6 <html> |
| 7 <head> | 7 <head> |
| 8 <style> | 8 <style> |
| 9 #canvas { | 9 #canvas { |
| 10 outline: solid 1px black; | 10 outline: solid 1px black; |
| (...skipping 14 matching lines...) Expand all Loading... |
| 25 ctx.fillStyle = 'red'; | 25 ctx.fillStyle = 'red'; |
| 26 ctx.fillRect(0, 0, 300, 300); | 26 ctx.fillRect(0, 0, 300, 300); |
| 27 runAfterLayoutAndPaint(repaintTest); | 27 runAfterLayoutAndPaint(repaintTest); |
| 28 } | 28 } |
| 29 | 29 |
| 30 function repaintTest() { | 30 function repaintTest() { |
| 31 var canvas = document.getElementById('canvas'); | 31 var canvas = document.getElementById('canvas'); |
| 32 // This changes the resolution of the canvas but keeps its layout size c
onstant. | 32 // This changes the resolution of the canvas but keeps its layout size c
onstant. |
| 33 canvas.width = canvas.width / 2; | 33 canvas.width = canvas.width / 2; |
| 34 if (window.testRunner) | 34 if (window.testRunner) |
| 35 testRunner.notifyDone(); | 35 testRunner.layoutAndPaintAsyncThen(function(){ testRunner.notifyDone()
; }); |
| 36 } | 36 } |
| 37 </script> | 37 </script> |
| 38 </head> | 38 </head> |
| 39 <body onload="runTest();"> | 39 <body onload="runTest();"> |
| 40 <canvas id="canvas" width="300" height="300"/> | 40 <canvas id="canvas" width="300" height="300"/> |
| 41 </body> | 41 </body> |
| 42 </html> | 42 </html> |
| OLD | NEW |