2 <canvas id=
"c" width=
"600" height=
"100"></canvas>
5 testRunner
.dumpAsTextWithPixelResults();
7 var canvas
= document
.getElementById("c");
8 var ctx
= canvas
.getContext("2d");
10 var gradient
= ctx
.createLinearGradient(0, 0, 0, 100);
11 gradient
.addColorStop(0.4, "#f00");
12 gradient
.addColorStop(0.6, "#00f");
14 ctx
.fillStyle
= gradient
;
15 ctx
.fillRect(0, 0, 100, 100);
17 gradient
.addColorStop(0, "#fff");
18 gradient
.addColorStop(1, "#fff");
19 ctx
.fillStyle
= gradient
;
20 ctx
.fillRect(150, 0, 100, 100);