OLD | NEW |
---|---|
1 <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN"> | 1 <script src="../../resources/testharness.js"></script> |
2 <html> | 2 <script src="../../resources/testharnessreport.js"></script> |
3 <head> | |
4 <script src="../../resources/js-test.js"></script> | |
5 </head> | |
6 <body> | 3 <body> |
7 <script src="script-tests/canvas-transparency-and-composite.js"></script> | 4 |
5 <script> | |
6 test(function(t) { | |
7 | |
8 var ctx = document.createElement('canvas').getContext('2d'); | |
9 ctx.globalCompositeOperation = "source-over"; | |
10 ctx.fillStyle = 'rgba(0, 0, 0, 0)'; | |
11 ctx.fillRect(0, 0, 100, 100); | |
12 | |
13 ctx.save(); | |
14 ctx.translate(0, 100); | |
15 ctx.scale(1, -1); | |
16 ctx.fillStyle = 'green'; | |
17 ctx.fillRect(0, 0, 100, 100); | |
18 ctx.restore(); | |
19 | |
20 assert_array_equals(ctx.getImageData(2, 1, 1, 1).data.slice(0, 3), [0, 128, 0]); | |
21 | |
22 }, "Series of tests to ensure correct behaviour of composite on a fully transpar ent color."); | |
Justin Novosad
2017/02/15 20:02:28
This does not look like a "series"
zakerinasab
2017/02/16 17:32:07
It is slipped from the old test. Corrected.
| |
23 </script> | |
8 </body> | 24 </body> |
9 </html> | |
OLD | NEW |