OLD | NEW |
1 <!-- Based on fast/repaint/canvas-resize.html --> | 1 <!-- Based on fast/repaint/canvas-resize.html --> |
2 <!DOCTYPE html> | 2 <!DOCTYPE html> |
3 <style> | 3 <style> |
4 canvas { | 4 canvas { |
5 position: absolute; | 5 position: absolute; |
6 width: 600px; | 6 width: 600px; |
7 height: 500px; | 7 height: 500px; |
8 top: 50px; | 8 top: 50px; |
9 left: 50px; | 9 left: 50px; |
10 } | 10 } |
11 </style> | 11 </style> |
12 Tests paint invalidation of canvas when it's resized. Passes if there is a whole
green circle. | 12 Tests paint invalidation of canvas when it's resized. Passes if there is a whole
green circle. |
13 <canvas id="canvas" width="500" height="500"></canvas> | 13 <canvas id="canvas" width="500" height="500"></canvas> |
14 | 14 |
15 <script src="resources/paint-invalidation-test.js"></script> | 15 <script src="resources/paint-invalidation-test.js"></script> |
16 <script> | 16 <script> |
17 window.expectedPaintInvalidationObjects = [ | |
18 "LayoutHTMLCanvas (positioned) CANVAS id='canvas'", | |
19 ]; | |
20 function paintInvalidationTest() { | 17 function paintInvalidationTest() { |
21 document.getElementById('canvas').style.width = '500px'; | 18 document.getElementById('canvas').style.width = '500px'; |
22 } | 19 } |
23 onload = runPaintInvalidationTest; | 20 onload = runPaintInvalidationTest; |
24 | 21 |
25 var ctx = document.getElementById('canvas').getContext('2d'); | 22 var ctx = document.getElementById('canvas').getContext('2d'); |
26 ctx.beginPath(); | 23 ctx.beginPath(); |
27 ctx.arc(250, 250, 250, 0, 2 * Math.PI); | 24 ctx.arc(250, 250, 250, 0, 2 * Math.PI); |
28 ctx.fillStyle = 'green'; | 25 ctx.fillStyle = 'green'; |
29 ctx.fill(); | 26 ctx.fill(); |
30 </script> | 27 </script> |
OLD | NEW |