15 var c1
= document
.getElementById('c1');
16 var ctx
= c1
.getContext('2d');
18 var grad
= ctx
.createLinearGradient(0, 0, 0, 150);
20 grad
.addColorStop(0, "green");
21 grad
.addColorStop(1, "transparent");
24 ctx
.fillRect(0, 0, 200, 200);
26 var c2
= document
.getElementById('c2');
27 ctx
= c2
.getContext('2d');
29 grad
= ctx
.createRadialGradient(75, 75, 0, 75, 75, 125);
31 grad
.addColorStop(0, "green");
32 grad
.addColorStop(1, "transparent");
35 ctx
.fillRect(0, 0, 200, 200);
38 <body onload=
"runTest()">
39 <div style=
"background-image: -webkit-linear-gradient(green 0%, transparent 100%);"></div>
40 <div style=
"background-image: -webkit-repeating-linear-gradient(green 0%, transparent 5%);"></div>
41 <div style=
"background-image: -webkit-radial-gradient(green 0%, transparent 100%);"></div>
42 <div style=
"background-image: -webkit-repeating-radial-gradient(green 0%, transparent 5%);"></div>
43 <canvas id=
"c1"></canvas>
44 <canvas id=
"c2"></canvas>
46 <svg xmlns=
"http://www.w3.org/2000/svg" version=
"1.1">
48 <linearGradient id=
"grad1" x1=
"0%" y1=
"0%" x2=
"0%" y2=
"100%">
49 <stop offset=
"0%" style=
"stop-color:green;stop-opacity:1" />
50 <stop offset=
"100%" style=
"stop-color:transparent;stop-opacity:0" />
53 <rect width=
"200" height=
"200" fill=
"url(#grad1)" />
56 <svg xmlns=
"http://www.w3.org/2000/svg" version=
"1.1">
58 <radialGradient id=
"grad2" cx=
"50%" cy=
"50%" r=
"80%" fx=
"50%" fy=
"50%">
59 <stop offset=
"0%" style=
"stop-color:green;stop-opacity:1" />
60 <stop offset=
"100%" style=
"stop-color:transparent;stop-opacity:0" />
63 <rect width=
"200" height=
"200" fill=
"url(#grad2)" />