OLD | NEW |
1 <!DOCTYPE html> | 1 <!DOCTYPE html> |
2 <html> | 2 <html> |
3 <head> | 3 <head> |
4 <title>Geometry Interfaces: DOMMatrix translate</title> | 4 <title>Geometry Interfaces: DOMMatrix translate</title> |
5 <script src="../../resources/testharness.js"></script> | 5 <script src="../../resources/testharness.js"></script> |
| 6 <script src="../../resources/testharnessreport.js"></script> |
6 </head> | 7 </head> |
7 <body> | 8 <body> |
8 <script> | 9 <script> |
9 | 10 |
10 test(function() { | 11 test(function() { |
11 var matrix = new DOMMatrix(); | 12 var matrix = new DOMMatrix(); |
12 assert_true(matrix.is2D); | 13 assert_true(matrix.is2D); |
13 assert_true(matrix.isIdentity); | 14 assert_true(matrix.isIdentity); |
14 assert_array_equals(matrix.toFloat64Array(), [ 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1
, 0, 0, 0, 0, 1 ]); | 15 assert_array_equals(matrix.toFloat64Array(), [ 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1
, 0, 0, 0, 0, 1 ]); |
15 var result = matrix.translate(2, 3); | 16 var result = matrix.translate(2, 3); |
(...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
106 assert_array_equals(matrix.toFloat64Array(), [ 1, 0, 0, 2, 0, 1, 0, 3, 0, 0, 1
, 4, 0, 0, 0, 7 ]); | 107 assert_array_equals(matrix.toFloat64Array(), [ 1, 0, 0, 2, 0, 1, 0, 3, 0, 0, 1
, 4, 0, 0, 0, 7 ]); |
107 matrix.translateSelf(7, -8, 2); | 108 matrix.translateSelf(7, -8, 2); |
108 assert_false(matrix.is2D); | 109 assert_false(matrix.is2D); |
109 assert_false(matrix.isIdentity); | 110 assert_false(matrix.isIdentity); |
110 assert_array_equals(matrix.toFloat64Array(), [ 1, 0, 0, 2, 0, 1, 0, 3, 0, 0, 1
, 4, 7, -8, 2, 5 ]); | 111 assert_array_equals(matrix.toFloat64Array(), [ 1, 0, 0, 2, 0, 1, 0, 3, 0, 0, 1
, 4, 7, -8, 2, 5 ]); |
111 }, "DOMMatrix.translateSelf(tx, ty, tz) Homogeneous Coordinates"); | 112 }, "DOMMatrix.translateSelf(tx, ty, tz) Homogeneous Coordinates"); |
112 | 113 |
113 </script> | 114 </script> |
114 </body> | 115 </body> |
115 </html> | 116 </html> |
OLD | NEW |