| 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-set-properties-with-non-invertible-ctm.js"></sc
    ript> | 4 <script> | 
|  | 5 var canvas = document.createElement("canvas"); | 
|  | 6 canvas.width = 100; | 
|  | 7 canvas.height = 100; | 
|  | 8 var ctx = canvas.getContext('2d'); | 
|  | 9 document.body.appendChild(canvas); | 
|  | 10 | 
|  | 11 function checkPixel(x, y, rgb) { | 
|  | 12     assert_array_equals(ctx.getImageData(x, y, 1, 1).data.slice(0,3), rgb); | 
|  | 13 } | 
|  | 14 | 
|  | 15 test(function(t) { | 
|  | 16     // Test our ability to set fillStyle | 
|  | 17     ctx.save(); | 
|  | 18     ctx.scale(0, 0); | 
|  | 19     ctx.fillStyle = "green"; | 
|  | 20     assert_equals(ctx.fillStyle, "#008000"); | 
|  | 21     ctx.setTransform(1, 0, 0, 1, 0, 0); | 
|  | 22     ctx.fillRect(0, 0, 100, 100); | 
|  | 23     checkPixel(50, 50, [0, 128, 0]); | 
|  | 24     ctx.restore(); | 
|  | 25 | 
|  | 26     // Test our ability to set strokeStyle | 
|  | 27     ctx.save(); | 
|  | 28     ctx.fillStyle = "red"; | 
|  | 29     ctx.fillRect(0, 0, 100, 100); | 
|  | 30     ctx.scale(0, 0); | 
|  | 31     ctx.strokeStyle = "green"; | 
|  | 32     assert_equals(ctx.strokeStyle, "#008000"); | 
|  | 33     ctx.lineWidth = 100; | 
|  | 34     ctx.setTransform(1, 0, 0, 1, 0, 0); | 
|  | 35     ctx.strokeRect(0, 0, 100, 100); | 
|  | 36     checkPixel(50, 50, [0, 128, 0]); | 
|  | 37     ctx.restore(); | 
|  | 38 | 
|  | 39     // test closePath | 
|  | 40     ctx.save(); | 
|  | 41     ctx.fillStyle = "red"; | 
|  | 42     ctx.fillRect(0, 0, 100, 100); | 
|  | 43 | 
|  | 44     ctx.beginPath(); | 
|  | 45     ctx.strokeStyle = "green"; | 
|  | 46     ctx.lineWidth = 100; | 
|  | 47     ctx.moveTo(-100, 50); | 
|  | 48     ctx.lineTo(-100, -100); | 
|  | 49     ctx.lineTo( 200, -100); | 
|  | 50     ctx.lineTo( 200, 50); | 
|  | 51     ctx.scale(0, 0); | 
|  | 52     ctx.closePath(); | 
|  | 53     ctx.setTransform(1, 0, 0, 1, 0, 0); | 
|  | 54     ctx.stroke(); | 
|  | 55     ctx.restore(); | 
|  | 56     checkPixel(50, 50, [0, 128, 0]); | 
|  | 57 | 
|  | 58     // Test beginPath behaviour | 
|  | 59     ctx.fillStyle = "green"; | 
|  | 60     ctx.fillRect(0, 0, 100, 100); | 
|  | 61     ctx.fillStyle = "red"; | 
|  | 62     ctx.rect(0, 0, 100, 100); | 
|  | 63     ctx.scale(0, 0); | 
|  | 64     ctx.beginPath(); | 
|  | 65     ctx.setTransform(1, 0, 0, 1, 0, 0); | 
|  | 66     ctx.fill(); | 
|  | 67 | 
|  | 68     checkPixel(50, 50, [0, 128, 0]); | 
|  | 69 | 
|  | 70 }, "Tests to make sure we can assign to non-ctm effected properties with a non-i
    nvertible ctm set"); | 
|  | 71 </script> | 
| 8 </body> | 72 </body> | 
| 9 </html> |  | 
| OLD | NEW | 
|---|