1 <!DOCTYPE HTML PUBLIC
"-//IETF//DTD HTML//EN">
4 <script src=
"../../resources/js-test.js"></script>
7 <canvas id=
"canvas" width=
"100" height=
"100"></canvas>
9 description("Bug 105650: Test correct rendering of quadratic and bezier curves with coincident endpoints");
10 var ctx
= document
.getElementById('canvas').getContext('2d');
13 function shouldBeYellow(x
,y
)
15 blue_value
= ctx
.getImageData(x
, y
, 1, 1).data
[2];
16 shouldBe("blue_value", "0");
19 function shouldBeBlue(x
,y
)
21 blue_value
= ctx
.getImageData(x
, y
, 1, 1).data
[2];
22 shouldBe("blue_value", "255");
25 ctx
.fillStyle
= '#00f';
26 ctx
.strokeStyle
= '#ff0';
30 ctx
.fillRect(0,0,100,100);
33 // bezier curve with coincident endpoints, horizontal line
34 ctx
.bezierCurveTo(0,0,200,0,0,0);
41 // bezier curve with coincident endpoints, vertical line
42 ctx
.bezierCurveTo(0,200,0,0,0,0);
47 // bezier curve with coincident endpoints
48 ctx
.bezierCurveTo(200,0,0,200,0,0);
50 shouldBeYellow(75,75);