| <html> |
| <head></head> |
| <body> |
| There should be a green square, followed by 6 squares of shades of green from white to full green.<br> |
| <canvas id="canvas" width="700" height="100" ></canvas> |
| <script> |
| if (window.testRunner) |
| testRunner.dumpAsText(true); |
| |
| var canvas = document.getElementById("canvas"); |
| var context = canvas.getContext("2d"); |
| context.fillStyle = 'green'; |
| context.fillRect(0,0,100,100); |
| var context2 = canvas.getContext("2d"); |
| context2.globalAlpha = 0.0; |
| context2.drawImage(canvas, 0, 0, 100, 100, 100, 0, 100, 100); |
| context2.globalAlpha = 0.2; |
| context2.drawImage(canvas, 0, 0, 100, 100, 200, 0, 100, 100); |
| context2.globalAlpha = 0.4; |
| context2.drawImage(canvas, 0, 0, 100, 100, 300, 0, 100, 100); |
| context2.globalAlpha = 0.6; |
| context2.drawImage(canvas, 0, 0, 100, 100, 400, 0, 100, 100); |
| context2.globalAlpha = 0.8; |
| context2.drawImage(canvas, 0, 0, 100, 100, 500, 0, 100, 100); |
| context2.globalAlpha = 1.0; |
| context2.drawImage(canvas, 0, 0, 100, 100, 600, 0, 100, 100); |
| </script> |
| </body> |
| </html> |