632781-normalsize.html (936B)
1 <!DOCTYPE html> 2 <html> 3 <body> 4 <!-- 5 This test makes sure that scrolling a normal sized canvas would correctly 6 scroll its contents. Normal sized canvases are accelerated, so this test 7 makes sure that the accelerated code path for this operaton works correctly. 8 9 The padding in this test is added mostly to make sure that scrollLeft/Top 10 correctly skip the padding. 11 --> 12 <div id="container" style="width: 100px; height: 100px; padding: 10px; overflow: hidden"> 13 <canvas width="300" height="300" id="c"></canvas> 14 </div> 15 <script> 16 var ctx = document.getElementById("c").getContext("2d"); 17 ctx.fillStyle = "red"; 18 ctx.fillRect(0, 0, 300, 100); 19 ctx.fillStyle = "green"; 20 ctx.fillRect(0, 100, 300, 200); 21 var container = document.getElementById("container"); 22 container.scrollLeft = 10; 23 container.scrollTop = 110; 24 </script> 25 </body> 26 </html>