2 <title>Canvas test:
2d.composite.operation.get
</title>
3 <script src=
"/MochiKit/MochiKit.js"></script>
4 <script src=
"/tests/SimpleTest/SimpleTest.js"></script>
5 <link rel=
"stylesheet" href=
"/tests/SimpleTest/test.css">
7 <canvas id=
"c" width=
"100" height=
"50"><p class=
"fallback">FAIL (fallback content)
</p></canvas>
10 SimpleTest
.waitForExplicitFinish();
11 MochiKit
.DOM
.addLoadEvent(function () {
13 var canvas
= document
.getElementById('c');
14 var ctx
= canvas
.getContext('2d');
16 var modes
= ['source-atop', 'source-in', 'source-out', 'source-over',
17 'destination-atop', 'destination-in', 'destination-out', 'destination-over',
18 'lighter', 'copy', 'xor'];
19 for (var i
= 0; i
< modes
.length
; ++i
)
21 ctx
.globalCompositeOperation
= modes
[i
];
22 ok(ctx
.globalCompositeOperation
== modes
[i
], "ctx.globalCompositeOperation == modes[\""+(i
)+"\"]");