OLD | NEW |
1 <!DOCTYPE html> | 1 <!DOCTYPE html> |
2 <html> | 2 <html> |
3 <head> | 3 <head> |
4 <script src="../js/resources/js-test-pre.js"></script> | 4 <script src="../../resources/js-test.js"></script> |
5 </head> | 5 </head> |
6 <body> | 6 <body> |
7 <script> | 7 <script> |
8 description("Test the handling of non-integer source coordinates in getImageData
()."); | 8 description("Test the handling of non-integer source coordinates in getImageData
()."); |
9 | 9 |
10 ctx = document.createElement('canvas').getContext('2d'); | 10 ctx = document.createElement('canvas').getContext('2d'); |
11 | 11 |
12 function dimensionsShouldBe(sx, sy, sw, sh, width, height) | 12 function dimensionsShouldBe(sx, sy, sw, sh, width, height) |
13 { | 13 { |
14 imageData = ctx.getImageData(sx, sy, sw, sh); | 14 imageData = ctx.getImageData(sx, sy, sw, sh); |
(...skipping 18 matching lines...) Expand all Loading... |
33 | 33 |
34 // Basic integer negative values | 34 // Basic integer negative values |
35 dimensionsShouldBe( -1, -1, 20, 10, 20, 10); | 35 dimensionsShouldBe( -1, -1, 20, 10, 20, 10); |
36 | 36 |
37 // Non-integer negative values | 37 // Non-integer negative values |
38 dimensionsShouldBe(-1.1, 0, 20, 10, 21, 10); | 38 dimensionsShouldBe(-1.1, 0, 20, 10, 21, 10); |
39 dimensionsShouldBe(-1.9, 0, 20, 10, 21, 10); | 39 dimensionsShouldBe(-1.9, 0, 20, 10, 21, 10); |
40 </script> | 40 </script> |
41 </body> | 41 </body> |
42 </html> | 42 </html> |
OLD | NEW |