OLD | NEW |
(Empty) | |
| 1 <!DOCTYPE HTML> |
| 2 <html> |
| 3 <head> |
| 4 <title>Geometry Interfaces: DOMMatrixReadOnly flip</title> |
| 5 <script src="../../resources/testharness.js"></script> |
| 6 <script src="../../resources/testharnessreport.js"></script> |
| 7 </head> |
| 8 <body> |
| 9 <script> |
| 10 test(function() { |
| 11 var matrix2d = new DOMMatrixReadOnly([1, 2, 3, 3.1, 2, 1]); |
| 12 var flipX = matrix2d.flipX(); |
| 13 assert_true(flipX.is2D); |
| 14 assert_equals(flipX.a, -1); |
| 15 assert_equals(flipX.b, -2); |
| 16 assert_equals(flipX.c, 3); |
| 17 assert_equals(flipX.d, 3.1); |
| 18 assert_equals(flipX.e, 2); |
| 19 assert_equals(flipX.f, 1); |
| 20 }, "DOMMatrixReadOnly flipX - 2D matrix"); |
| 21 |
| 22 test(function() { |
| 23 var matrix3d = new DOMMatrixReadOnly([1, 2, 3, 4, 5, 6, 7, 8, 9, 10.1, 11, 1
2, 13, 14, 15, 16.6]); |
| 24 var flipX = matrix3d.flipX(); |
| 25 assert_false(flipX.is2D); |
| 26 assert_equals(flipX.m11, -1); |
| 27 assert_equals(flipX.m12, -2); |
| 28 assert_equals(flipX.m13, -3); |
| 29 assert_equals(flipX.m14, -4); |
| 30 assert_equals(flipX.m21, 5); |
| 31 assert_equals(flipX.m22, 6); |
| 32 assert_equals(flipX.m23, 7); |
| 33 assert_equals(flipX.m24, 8); |
| 34 assert_equals(flipX.m31, 9); |
| 35 assert_equals(flipX.m32, 10.1); |
| 36 assert_equals(flipX.m33, 11); |
| 37 assert_equals(flipX.m34, 12); |
| 38 assert_equals(flipX.m41, 13); |
| 39 assert_equals(flipX.m42, 14); |
| 40 assert_equals(flipX.m43, 15); |
| 41 assert_equals(flipX.m44, 16.6); |
| 42 }, "DOMMatrixReadOnly flipX - 3D matrix"); |
| 43 |
| 44 test(function() { |
| 45 var matrix2d = new DOMMatrixReadOnly([1, 2, 3, 3.1, 2, 1]); |
| 46 var flipY = matrix2d.flipY(); |
| 47 assert_true(flipY.is2D); |
| 48 assert_equals(flipY.a, 1); |
| 49 assert_equals(flipY.b, 2); |
| 50 assert_equals(flipY.c, -3); |
| 51 assert_equals(flipY.d, -3.1); |
| 52 assert_equals(flipY.e, 2); |
| 53 assert_equals(flipY.f, 1); |
| 54 }, "DOMMatrixReadOnly flipY - 2D matrix"); |
| 55 |
| 56 test(function() { |
| 57 var matrix3d = new DOMMatrixReadOnly([1, 2, 3, 4, 5, 6, 7, 8, 9, 10.1, 11, 1
2, 13, 14, 15, 16.6]); |
| 58 var flipY = matrix3d.flipY(); |
| 59 assert_false(flipY.is2D); |
| 60 assert_equals(flipY.m11, 1); |
| 61 assert_equals(flipY.m12, 2); |
| 62 assert_equals(flipY.m13, 3); |
| 63 assert_equals(flipY.m14, 4); |
| 64 assert_equals(flipY.m21, -5); |
| 65 assert_equals(flipY.m22, -6); |
| 66 assert_equals(flipY.m23, -7); |
| 67 assert_equals(flipY.m24, -8); |
| 68 assert_equals(flipY.m31, 9); |
| 69 assert_equals(flipY.m32, 10.1); |
| 70 assert_equals(flipY.m33, 11); |
| 71 assert_equals(flipY.m34, 12); |
| 72 assert_equals(flipY.m41, 13); |
| 73 assert_equals(flipY.m42, 14); |
| 74 assert_equals(flipY.m43, 15); |
| 75 assert_equals(flipY.m44, 16.6); |
| 76 }, "DOMMatrixReadOnly flipY - 3D matrix"); |
| 77 </script> |
| 78 </body> |
| 79 </html> |
OLD | NEW |