OLD | NEW |
| (Empty) |
1 <!-- Based on fast/repaint/canvas-resize-no-full-invalidation.html --> | |
2 <!DOCTYPE html> | |
3 <style> | |
4 canvas { | |
5 position: absolute; | |
6 width: 600px; | |
7 height: 500px; | |
8 top: 50px; | |
9 left: 50px; | |
10 /* object-fit and object-position make the content of the canvas not affected | |
11 by the resize in paintInvalidationTest(). */ | |
12 object-fit: contain; | |
13 object-position: 0 0; | |
14 background-color: #030; | |
15 } | |
16 </style> | |
17 Tests paint invalidation of canvas when it's resized which doesn't affect its co
ntents. Passes if there is only incremental invalidation for the resized backgro
und. | |
18 <canvas id="canvas" width="500" height="500"></canvas> | |
19 | |
20 <script src="resources/paint-invalidation-test.js"></script> | |
21 <script> | |
22 function paintInvalidationTest() { | |
23 document.getElementById('canvas').style.width = '500px'; | |
24 } | |
25 onload = runPaintInvalidationTest; | |
26 | |
27 var ctx = document.getElementById('canvas').getContext('2d'); | |
28 ctx.beginPath(); | |
29 ctx.arc(250, 250, 250, 0, 2 * Math.PI); | |
30 ctx.fillStyle = 'green'; | |
31 ctx.fill(); | |
32 </script> | |
OLD | NEW |