2 <script src=
"../../resources/run-after-layout-and-paint.js"></script>
3 <body onload=
"runAfterLayoutAndPaint(repaintTest);">
4 <canvas id=
"canvas-source-in" width=
"100" height=
"100"></canvas>
5 <canvas id=
"canvas-copy" width=
"100" height=
"100"></canvas>
7 var compositeTypes
= ['source-in','copy'];
9 if (window
.testRunner
) {
10 testRunner
.dumpAsTextWithPixelResults();
11 testRunner
.waitUntilDone();
14 for (i
= 0; i
< compositeTypes
.length
; i
++) {
15 var canvas
= document
.getElementById('canvas-' + compositeTypes
[i
]);
16 var ctx
= canvas
.getContext('2d');
17 ctx
.fillStyle
= '#0f0';
18 ctx
.fillRect(0, 0, 100, 100);
21 function repaintTest()
23 for (i
= 0; i
< compositeTypes
.length
; i
++) {
24 var canvas
= document
.getElementById('canvas-' + compositeTypes
[i
]);
25 var ctx
= canvas
.getContext('2d');
26 ctx
.globalCompositeOperation
= compositeTypes
[i
];
27 ctx
.fillStyle
= '#00f';
28 ctx
.fillRect(40, 40, 20, 20);
30 if (window
.testRunner
)
31 testRunner
.notifyDone();