OLD | NEW |
1 <!DOCTYPE html> | 1 <!DOCTYPE html> |
2 <html xmlns="http://www.w3.org/1999/xhtml"> | 2 <html xmlns="http://www.w3.org/1999/xhtml"> |
3 <head> | 3 <head> |
4 <title>canvas toDataURL alpha png bug</title> | 4 <title>canvas toDataURL alpha png bug</title> |
5 <script type="text/javascript"> | 5 <script type="text/javascript"> |
6 if (window.testRunner) | 6 if (window.testRunner) |
7 testRunner.dumpAsText(true); | 7 testRunner.dumpAsTextWithPixelResults(); |
8 | 8 |
9 function load() { | 9 function load() { |
10 var context = document.getElementById("c").getContext("2d"); | 10 var context = document.getElementById("c").getContext("2d"); |
11 context.fillStyle = "rgba(200, 255, 200, 0.7)"; | 11 context.fillStyle = "rgba(200, 255, 200, 0.7)"; |
12 context.fillRect(0, 0, context.canvas.width, context.canvas.height); | 12 context.fillRect(0, 0, context.canvas.width, context.canvas.height); |
13 document.getElementById("d").style.backgroundImage = ["url(", context.canv
as.toDataURL("image/png"), ")"].join(""); | 13 document.getElementById("d").style.backgroundImage = ["url(", context.canv
as.toDataURL("image/png"), ")"].join(""); |
14 } | 14 } |
15 </script> | 15 </script> |
16 </head> | 16 </head> |
17 <body onload="load()"> | 17 <body onload="load()"> |
18 <p>The test passes if both boxes below have the same color.</p> | 18 <p>The test passes if both boxes below have the same color.</p> |
19 <canvas id="c" width="200" height="100"></canvas> | 19 <canvas id="c" width="200" height="100"></canvas> |
20 <div id="d" style="width:200px;height:100px"></div> | 20 <div id="d" style="width:200px;height:100px"></div> |
21 </body> | 21 </body> |
22 </html> | 22 </html> |
OLD | NEW |