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);
32 // quadratic with coincident endpoint
35 //Next line should be close to ctx.bezierCurveTo(81,80,80,80,20,20);
36 ctx
.quadraticCurveTo(110,110,20,20);
40 shouldBeYellow(70,70);