Move parseFontFaceDescriptor to CSSPropertyParser.cpp
[chromium-blink-merge.git] / third_party / WebKit / LayoutTests / fast / canvas / canvas-getImageData-rounding.html
bloba2d93f9e51bcc1d5ee21d76bfdff5335ceea1b25
1 <!DOCTYPE html>
2 <html>
3 <head>
4 <script src="../../resources/js-test.js"></script>
5 </head>
6 <body>
7 <script>
8 description("Test the handling of non-integer source coordinates in getImageData().");
10 ctx = document.createElement('canvas').getContext('2d');
12 function dimensionsShouldBe(sx, sy, sw, sh, width, height)
14 imageData = ctx.getImageData(sx, sy, sw, sh);
15 debug('getImageData(' + sx + ', ' + sy + ', ' + sw + ', ' + sh + ')');
16 shouldBe('imageData.width', width + '');
17 shouldBe('imageData.height', height + '');
20 // Basic integer values
21 dimensionsShouldBe( 0, 0, 20, 10, 20, 10);
23 // Source point is not an integer
24 dimensionsShouldBe( .1, .2, 20, 10, 21, 11);
25 dimensionsShouldBe( .9, .8, 20, 10, 21, 11);
27 // Size is not an integer
28 dimensionsShouldBe( 0, 0, 19.9, 9.9, 20, 10);
29 dimensionsShouldBe( 0, 0, 19.1, 9.1, 20, 10);
31 // Width straddles a pixel boundary
32 dimensionsShouldBe( .9, 0, .2, 10, 2, 10);
34 // Basic integer negative values
35 dimensionsShouldBe( -1, -1, 20, 10, 20, 10);
37 // Non-integer negative values
38 dimensionsShouldBe(-1.1, 0, 20, 10, 21, 10);
39 dimensionsShouldBe(-1.9, 0, 20, 10, 21, 10);
40 </script>
41 </body>
42 </html>