OLD | NEW |
1 <html> | 1 <html> |
2 <head> | 2 <head> |
3 <style> | 3 <style> |
4 div { | 4 div { |
5 width:600px; | 5 width:600px; |
6 height:500px; | 6 height:500px; |
7 border:2px solid black; | 7 border:2px solid black; |
8 content: -webkit-canvas(squares); | 8 content: -webkit-canvas(squares); |
9 } | 9 } |
10 </style> | 10 </style> |
11 | 11 <script src="resources/repaint.js"></script> |
12 <script type="application/x-javascript"> | 12 <script type="application/x-javascript"> |
13 if (window.testRunner) | |
14 testRunner.waitUntilDone(); | |
15 | |
16 var canvasContext; | |
17 function runRepaintTest() | |
18 { | |
19 canvasContext = document.getCSSCanvasContext("2d", "squares", 300, 300); | |
20 if (window.testRunner) { | |
21 document.body.offsetTop; | |
22 testRunner.display(); | |
23 repaintTest(); | |
24 testRunner.notifyDone(); | |
25 } else { | |
26 setTimeout(repaintTest, 2000); | |
27 } | |
28 } | |
29 | |
30 function repaintTest() | 13 function repaintTest() |
31 { | 14 { |
32 draw(); | 15 var ctx = document.getCSSCanvasContext("2d", "squares", 300, 300); |
33 } | |
34 | |
35 function draw() | |
36 { | |
37 var ctx = canvasContext; | |
38 | 16 |
39 ctx.fillStyle = "rgb(200,0,0)"; | 17 ctx.fillStyle = "rgb(200,0,0)"; |
40 ctx.fillRect (10, 10, 100, 100); | 18 ctx.fillRect (10, 10, 100, 100); |
41 | 19 |
42 ctx.fillStyle = "rgba(0, 0, 200, 0.5)"; | 20 ctx.fillStyle = "rgba(0, 0, 200, 0.5)"; |
43 ctx.fillRect (50, 50, 100, 100); | 21 ctx.fillRect (50, 50, 100, 100); |
44 } | 22 } |
45 </script> | 23 </script> |
46 </head> | 24 </head> |
47 <body onload="runRepaintTest()"> | 25 <body onload="runRepaintTest()"> |
48 <div></div> | 26 <div></div> |
49 </body> | 27 </body> |
50 </html> | 28 </html> |
OLD | NEW |