blob: a5f1bc88485dce3acab22809808e1f2c1f095de2 [file] [log] [blame]
inferno@chromium.orgad91daf2010-12-10 03:56:31 +00001<!DOCTYPE html>
2<html>
3 <body>
4 <script>
rniwa@webkit.org38608af2012-06-19 07:23:13 +00005 if (window.testRunner)
6 testRunner.dumpAsText();
inferno@chromium.orgad91daf2010-12-10 03:56:31 +00007
8 function newCanvasContext() {
9 canvas = document.createElement("canvas");
10 canvas.width = 100;
11 canvas.height = 100;
12 return canvas.getContext("2d");
13 }
14
15 window.onload = function () {
16 ctx = newCanvasContext();
17 ctx.fillStyle = '#0f0';
18 ctx.fillRect(0, 0, 100, 50);
19 ctx.moveTo(10500000000, 10500000000);
20 ctx.lineTo(110, -10);
21 ctx.lineTo(-10, 60);
22 ctx.fill();
23 ctx.getImageData(50, 25, 1, 1);
24
25 ctx = newCanvasContext();
26 ctx.fillStyle = '#0f0';
27 ctx.scale(4500000000, 4500000000);
28 ctx.moveTo(0, 0.5);
29 ctx.lineTo(2, 0.5);
30 ctx.stroke();
31 ctx.getImageData(50, 25, 1, 1);
32
33 ctx = newCanvasContext();
34 ctx.fillStyle = '#0f0';
35 ctx.fillRect(0, 0, 100, 50);
36 ctx.scale(2, -4500000000);
37 ctx.arc(25, 50, 56, 0, 2*Math.PI, false);
38 ctx.fill();
39 ctx.arc(105000000005, -105000000005, 105000000004, 0, 10500000000*Math.PI, false);
40 ctx.fill();
41 ctx.getImageData(50, 25, 1, 1);
42 }
43 </script>
44 PASS: Draw commands with big numbers cause no problems.
45 </body>
46</html>
47