Wed, 31 Dec 2014 07:16:47 +0100
Revert simplistic fix pending revisit of Mozilla integration attempt.
michael@0 | 1 | <!DOCTYPE html> |
michael@0 | 2 | |
michael@0 | 3 | <html lang="en" xmlns="http://www.w3.org/1999/xhtml"> |
michael@0 | 4 | <head> |
michael@0 | 5 | <meta charset="utf-8" /> |
michael@0 | 6 | <title></title> |
michael@0 | 7 | <script type="text/javascript"> |
michael@0 | 8 | function paintCanvas() { |
michael@0 | 9 | var elem = document.getElementById("mycanv"); |
michael@0 | 10 | var ctx = elem.getContext('2d'); |
michael@0 | 11 | |
michael@0 | 12 | ctx.fillStyle = 'white'; |
michael@0 | 13 | ctx.fillRect(0, 0, 200, 200); |
michael@0 | 14 | ctx.beginPath(); |
michael@0 | 15 | ctx.arc(150, 150, 100, 0, Math.PI * 2, true); |
michael@0 | 16 | ctx.closePath(); |
michael@0 | 17 | ctx.clip(); |
michael@0 | 18 | |
michael@0 | 19 | // create radial gradient |
michael@0 | 20 | var grd = ctx.createRadialGradient(110, 110, 42, 110, 110, 121); |
michael@0 | 21 | grd.addColorStop(0, '#FFFFFF'); |
michael@0 | 22 | grd.addColorStop(1, '#E5E5E5'); |
michael@0 | 23 | |
michael@0 | 24 | ctx.fillStyle = grd; |
michael@0 | 25 | // This should be completely clipped out! |
michael@0 | 26 | ctx.fillRect(0, 0, 1, 1); |
michael@0 | 27 | } |
michael@0 | 28 | </script> |
michael@0 | 29 | </head> |
michael@0 | 30 | <body onload="paintCanvas();"> |
michael@0 | 31 | <canvas width=200 height=200 moz-opaque="true" id="mycanv"></canvas> |
michael@0 | 32 | </body> |
michael@0 | 33 | </html> |