| OLD | NEW |
| (Empty) | |
| 1 <!DOCTYPE html> |
| 2 <canvas id="cnv" width=140 height=140></canvas> |
| 3 |
| 4 <script> |
| 5 // This layout test checks if the 2D canvas is properly displayed |
| 6 // when the color space is set to linear-rgb. |
| 7 |
| 8 var g_swapsBeforeAck = 15; |
| 9 |
| 10 function main() |
| 11 { |
| 12 draw(); |
| 13 waitForFinish(); |
| 14 } |
| 15 |
| 16 function draw() |
| 17 { |
| 18 var ctx = document.getElementById("cnv").getContext("2d", {colorSpace:'linear-
rgb'}); |
| 19 ctx.fillStyle = 'red'; |
| 20 ctx.fillRect(20,20,50,50); |
| 21 ctx.fillStyle = 'green'; |
| 22 ctx.fillRect(70,20,50,50); |
| 23 ctx.fillStyle = 'blue'; |
| 24 ctx.fillRect(20,70,50,50); |
| 25 ctx.fillStyle = 'black'; |
| 26 ctx.fillRect(70,70,50,50); |
| 27 } |
| 28 |
| 29 function waitForFinish() |
| 30 { |
| 31 if (g_swapsBeforeAck == 0) { |
| 32 domAutomationController.setAutomationId(1); |
| 33 domAutomationController.send("SUCCESS"); |
| 34 } else { |
| 35 g_swapsBeforeAck--; |
| 36 document.getElementById('container').style.zIndex = g_swapsBeforeAck + 1; |
| 37 window.webkitRequestAnimationFrame(waitForFinish); |
| 38 } |
| 39 } |
| 40 |
| 41 main(); |
| 42 </script> |
| 43 |
| 44 |
| OLD | NEW |