[Cairo] Canvas putImageData is not working as expected
[WebKit-https.git] / LayoutTests / fast / canvas / canvas-putImageData-zero-alpha.html
1 <!DOCTYPE html>
2 <html>
3 <head>
4   <style>
5   body {
6     background-color:blue;
7   }
8
9   #box {
10     width:100px;
11     height:100px;
12     border:1px solid;
13   }
14   </style>
15   <script>
16     if (window.testRunner) {
17       testRunner.dumpAsText(true);
18       testRunner.waitUntilDone();
19     }
20     function doTest()
21     {
22       var c = document.getElementById("box");
23       var ctx = c.getContext("2d");
24
25       var imgData = ctx.createImageData(100, 100);
26       for (var i = 0; i < imgData.data.length ; i += 4) {
27         imgData.data[i + 0] = 255;
28         imgData.data[i + 1] = 0;
29         imgData.data[i + 2] = 0;
30         imgData.data[i + 3] = 0;
31       }
32       ctx.putImageData(imgData, 0, 0);
33       if (window.testRunner)
34         testRunner.notifyDone();
35     }
36     window.addEventListener('load', doTest, false);
37   </script>
38 </head>
39 <body>
40   <canvas id="box" width="100" height="100">
41   </canvas>
42 </body>
43 </html>