| OLD | NEW |
| 1 <!DOCTYPE HTML> | 1 <!DOCTYPE HTML> |
| 2 <script src="../../resources/testharness.js"></script> | 2 <script src="../../resources/testharness.js"></script> |
| 3 <script src="../../resources/testharnessreport.js"></script> | 3 <script src="../../resources/testharnessreport.js"></script> |
| 4 <script src="./resources/geometry-interfaces-test-helpers.js"></script> | 4 <script src="./resources/geometry-interfaces-test-helpers.js"></script> |
| 5 <script> | 5 <script> |
| 6 | 6 |
| 7 test(() => { | 7 test(() => { |
| 8 var matrix = new DOMMatrixReadOnly(); | 8 var matrix = new DOMMatrixReadOnly(); |
| 9 assert_identity_2d_matrix(matrix); | 9 assert_identity_2d_matrix(matrix); |
| 10 }, "DOMMatrixReadOnly constructor"); | 10 }, "DOMMatrixReadOnly constructor"); |
| (...skipping 28 matching lines...) Expand all Loading... |
| 39 }, "DOMMatrixReadOnly fromFloat32Array - 3D matrix"); | 39 }, "DOMMatrixReadOnly fromFloat32Array - 3D matrix"); |
| 40 | 40 |
| 41 test(() => { | 41 test(() => { |
| 42 // 10.1 and 16.6 are not representable as a 32-bit float | 42 // 10.1 and 16.6 are not representable as a 32-bit float |
| 43 var float64Array = new Float64Array([1, 2, 3, 4, 5, 6, 7, 8, 9, 10.1, 11, 12,
13, 14, 15, 16.6]); | 43 var float64Array = new Float64Array([1, 2, 3, 4, 5, 6, 7, 8, 9, 10.1, 11, 12,
13, 14, 15, 16.6]); |
| 44 var matrix3d = DOMMatrixReadOnly.fromFloat64Array(float64Array); | 44 var matrix3d = DOMMatrixReadOnly.fromFloat64Array(float64Array); |
| 45 assert_3d_matrix_equals(matrix3d, [1, 2, 3, 4, 5, 6, 7, 8, 9, 10.1, 11, 12, 13
, 14, 15, 16.6]); | 45 assert_3d_matrix_equals(matrix3d, [1, 2, 3, 4, 5, 6, 7, 8, 9, 10.1, 11, 12, 13
, 14, 15, 16.6]); |
| 46 }, "DOMMatrixReadOnly fromFloat64Array - 3D matrix"); | 46 }, "DOMMatrixReadOnly fromFloat64Array - 3D matrix"); |
| 47 | 47 |
| 48 test(() => { | 48 test(() => { |
| 49 var matrix = new DOMMatrixReadOnly(""); |
| 50 assert_identity_2d_matrix(matrix); |
| 51 }, "DOMMatrixReadOnly(transformList) - emptyString"); |
| 52 |
| 53 test(() => { |
| 54 var matrix = new DOMMatrixReadOnly("matrix(1.0, 2.0, 3.0, 4.0, 5.0, 6.0) trans
late(44px, 55px) skewX(30deg)"); |
| 55 var expectedMatrix = new DOMMatrixReadOnly(); |
| 56 expectedMatrix = expectedMatrix.multiply(new DOMMatrixReadOnly([1.0, 2.0, 3.0,
4.0, 5.0, 6.0])) |
| 57 expectedMatrix = expectedMatrix.translate(44, 55) |
| 58 expectedMatrix = expectedMatrix.skewX(30); |
| 59 assert_matrix_almost_equals(matrix, expectedMatrix); |
| 60 }, "DOMMatrixReadOnly(transformList) - transformList"); |
| 61 |
| 62 test(() => { |
| 49 var matrix2d = new DOMMatrixReadOnly([1, 2, 3, 3.1, 2, 1]); | 63 var matrix2d = new DOMMatrixReadOnly([1, 2, 3, 3.1, 2, 1]); |
| 50 assert_true(matrix2d.is2D); | 64 assert_true(matrix2d.is2D); |
| 51 assert_equals(matrix2d.toString(), "matrix(1, 2, 3, 3.1, 2, 1)"); | 65 assert_equals(matrix2d.toString(), "matrix(1, 2, 3, 3.1, 2, 1)"); |
| 52 }, "DOMMatrixReadOnly toString() - 2D matrix"); | 66 }, "DOMMatrixReadOnly toString() - 2D matrix"); |
| 53 | 67 |
| 54 test(() => { | 68 test(() => { |
| 55 var matrix3d = new DOMMatrixReadOnly([1, 2, 3, 4, 5, 6, 7, 8, 9, 10.1, 11, 12,
13, 14, 15, 16.6]); | 69 var matrix3d = new DOMMatrixReadOnly([1, 2, 3, 4, 5, 6, 7, 8, 9, 10.1, 11, 12,
13, 14, 15, 16.6]); |
| 56 assert_false(matrix3d.is2D); | 70 assert_false(matrix3d.is2D); |
| 57 assert_equals(matrix3d.toString(), "matrix3d(1, 2, 3, 4, 5, 6, 7, 8, 9, 10.1,
11, 12, 13, 14, 15, 16.6)"); | 71 assert_equals(matrix3d.toString(), "matrix3d(1, 2, 3, 4, 5, 6, 7, 8, 9, 10.1,
11, 12, 13, 14, 15, 16.6)"); |
| 58 }, "DOMMatrixReadOnly toString() - 3D matrix"); | 72 }, "DOMMatrixReadOnly toString() - 3D matrix"); |
| (...skipping 28 matching lines...) Expand all Loading... |
| 87 assert_object_equals(matrix3d.toJSON(), | 101 assert_object_equals(matrix3d.toJSON(), |
| 88 { a : 1, b : 2, c : 5, d : 6, e : 13, f : 14, | 102 { a : 1, b : 2, c : 5, d : 6, e : 13, f : 14, |
| 89 is2D : false, isIdentity : false, | 103 is2D : false, isIdentity : false, |
| 90 m11 : 1, m12 : 2, m13 : 3, m14 : 4, | 104 m11 : 1, m12 : 2, m13 : 3, m14 : 4, |
| 91 m21 : 5, m22 : 6, m23 : 7, m24 : 8, | 105 m21 : 5, m22 : 6, m23 : 7, m24 : 8, |
| 92 m31 : 9, m32 : 10.1, m33 : 11, m34 : 12, | 106 m31 : 9, m32 : 10.1, m33 : 11, m34 : 12, |
| 93 m41 : 13, m42 : 14, m43 : 15, m44 : 16.6}); | 107 m41 : 13, m42 : 14, m43 : 15, m44 : 16.6}); |
| 94 }, "DOMMatrixReadOnly toJSON() - 3D matrix"); | 108 }, "DOMMatrixReadOnly toJSON() - 3D matrix"); |
| 95 | 109 |
| 96 test(() => { | 110 test(() => { |
| 97 assert_throws(new TypeError(), () => { new DOMMatrixReadOnly(1, 2, 3, 4, 5, 6)
; }, | 111 assert_throws(new SyntaxError(), () => { new DOMMatrixReadOnly(1, 2, 3, 4, 5,
6); }, |
| 98 "DOMMatrixReadOnly constructor only accepts 1 argument"); | 112 "DOMMatrixReadOnly(transformList) can't parse unknown keyword - DOMMatrixRea
dOnly(1, 2, 3, 4, 5, 6) is same with DOMMatrixReadOnly('1')"); |
| 99 assert_throws(new TypeError(), () => { new DOMMatrixReadOnly("myString"); }, | 113 assert_throws(new SyntaxError(), () => { new DOMMatrixReadOnly("myString"); }, |
| 100 "DOMMatrixReadOnly constructor only accepts 1 number sequence"); | 114 "DOMMatrixReadOnly(transformList) can't parse unknown keyword"); |
| 115 assert_throws(new SyntaxError(), () => { new DOMMatrixReadOnly("initial");}, |
| 116 "CSS-wide keywords are disallowed"); |
| 117 assert_throws(new SyntaxError(), () => { new DOMMatrixReadOnly("notExistFuncti
on()"); }, |
| 118 "can't parse not exist function"); |
| 119 assert_throws(new SyntaxError(), () => { new DOMMatrixReadOnly("translateY(50%
)"); }, |
| 120 "using relative units should throw a SyntaxError"); |
| 121 assert_throws(new SyntaxError(), () => { new DOMMatrixReadOnly("translateX(1.2
em)"); }, |
| 122 "using relative units should throw a SyntaxError"); |
| 123 assert_throws(new SyntaxError(), () => { new DOMMatrixReadOnly("translateX(10e
x)"); }, |
| 124 "using relative units should throw a SyntaxError"); |
| 125 assert_throws(new SyntaxError(), () => { new DOMMatrixReadOnly("translateX(10c
h)"); }, |
| 126 "using relative units should throw a SyntaxError"); |
| 127 assert_throws(new SyntaxError(), () => { new DOMMatrixReadOnly("translateX(10r
em)"); }, |
| 128 "using relative units should throw a SyntaxError"); |
| 129 assert_throws(new SyntaxError(), () => { new DOMMatrixReadOnly("translateX(10v
w)"); }, |
| 130 "using relative units should throw a SyntaxError"); |
| 131 assert_throws(new SyntaxError(), () => { new DOMMatrixReadOnly("translateX(10v
h)"); }, |
| 132 "using relative units should throw a SyntaxError"); |
| 133 assert_throws(new SyntaxError(), () => { new DOMMatrixReadOnly("translateX(10v
min)"); }, |
| 134 "using relative units should throw a SyntaxError"); |
| 135 assert_throws(new SyntaxError(), () => { new DOMMatrixReadOnly("translateX(10v
max)"); }, |
| 136 "using relative units should throw a SyntaxError"); |
| 137 assert_throws(new SyntaxError(), () => { new DOMMatrixReadOnly("translateX(cal
c(10px + 1em))"); }, |
| 138 "using relative units should throw a SyntaxError"); |
| 101 assert_throws(new TypeError(), () => { new DOMMatrixReadOnly([1, 2, 3]); }, | 139 assert_throws(new TypeError(), () => { new DOMMatrixReadOnly([1, 2, 3]); }, |
| 102 "DOMMatrixReadOnly constructor only accepts 1 number sequence with 6 or 16 e
lements."); | 140 "DOMMatrixReadOnly constructor only accepts 1 number sequence with 6 or 16 e
lements"); |
| 103 }, "DOMMatrixReadOnly constructor - invalid arguments"); | 141 }, "DOMMatrixReadOnly constructor - invalid arguments"); |
| 104 | 142 |
| 105 test(() => { | 143 test(() => { |
| 106 assert_throws(new TypeError(), () => { DOMMatrixReadOnly.fromFloat32Array(new
Float32Array([1, 2, 3, 4, 5])); }, | 144 assert_throws(new TypeError(), () => { DOMMatrixReadOnly.fromFloat32Array(new
Float32Array([1, 2, 3, 4, 5])); }, |
| 107 "fromFloat32Array function only accepts 1 Float32Array with 6 or 16 elements
."); | 145 "fromFloat32Array function only accepts 1 Float32Array with 6 or 16 elements
"); |
| 108 assert_throws(new TypeError(), () => { DOMMatrixReadOnly.fromFloat64Array(new
Float64Array([1, 2, 3, 4, 5])); }, | 146 assert_throws(new TypeError(), () => { DOMMatrixReadOnly.fromFloat64Array(new
Float64Array([1, 2, 3, 4, 5])); }, |
| 109 "fromFloat64Array function only accepts 1 Float64Array with 6 or 16 elements
."); | 147 "fromFloat64Array function only accepts 1 Float64Array with 6 or 16 elements
"); |
| 110 assert_throws(new TypeError(), () => { DOMMatrixReadOnly.fromFloat32Array(new
Float32Array([1, 2, 3, 4, 5, 6 ,7])); }, | 148 assert_throws(new TypeError(), () => { DOMMatrixReadOnly.fromFloat32Array(new
Float32Array([1, 2, 3, 4, 5, 6 ,7])); }, |
| 111 "fromFloat32Array function only accepts 1 Float32Array with 6 or 16 elements
."); | 149 "fromFloat32Array function only accepts 1 Float32Array with 6 or 16 elements
"); |
| 112 assert_throws(new TypeError(), () => { DOMMatrixReadOnly.fromFloat64Array(new
Float64Array([1, 2, 3, 4, 5, 6 ,7])); }, | 150 assert_throws(new TypeError(), () => { DOMMatrixReadOnly.fromFloat64Array(new
Float64Array([1, 2, 3, 4, 5, 6 ,7])); }, |
| 113 "fromFloat64Array function only accepts 1 Float64Array with 6 or 16 elements
."); | 151 "fromFloat64Array function only accepts 1 Float64Array with 6 or 16 elements
"); |
| 114 }, "DOMMatrixReadOnly fromFloat*Array - invalid array size of nearby 6"); | 152 }, "DOMMatrixReadOnly fromFloat*Array - invalid array size of nearby 6"); |
| 115 | 153 |
| 116 test(() => { | 154 test(() => { |
| 117 assert_throws(new TypeError(), () => { DOMMatrixReadOnly.fromFloat32Array(new
Float32Array([1, 2, 3, 4, 5, 6 ,7, 8, 9, 10, 11, 12, 13, 14, 15])); }, | 155 assert_throws(new TypeError(), () => { DOMMatrixReadOnly.fromFloat32Array(new
Float32Array([1, 2, 3, 4, 5, 6 ,7, 8, 9, 10, 11, 12, 13, 14, 15])); }, |
| 118 "fromFloat32Array function only accepts 1 Float32Array with 6 or 16 elements
."); | 156 "fromFloat32Array function only accepts 1 Float32Array with 6 or 16 elements
"); |
| 119 assert_throws(new TypeError(), () => { DOMMatrixReadOnly.fromFloat64Array(new
Float64Array([1, 2, 3, 4, 5, 6 ,7, 8, 9, 10, 11, 12, 13, 14, 15])); }, | 157 assert_throws(new TypeError(), () => { DOMMatrixReadOnly.fromFloat64Array(new
Float64Array([1, 2, 3, 4, 5, 6 ,7, 8, 9, 10, 11, 12, 13, 14, 15])); }, |
| 120 "fromFloat64Array function only accepts 1 Float64Array with 6 or 16 elements
."); | 158 "fromFloat64Array function only accepts 1 Float64Array with 6 or 16 elements
"); |
| 121 assert_throws(new TypeError(), () => { DOMMatrixReadOnly.fromFloat32Array(new
Float32Array([1, 2, 3, 4, 5, 6 ,7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17])); }, | 159 assert_throws(new TypeError(), () => { DOMMatrixReadOnly.fromFloat32Array(new
Float32Array([1, 2, 3, 4, 5, 6 ,7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17])); }, |
| 122 "fromFloat32Array function only accepts 1 Float32Array with 6 or 16 elements
."); | 160 "fromFloat32Array function only accepts 1 Float32Array with 6 or 16 elements
"); |
| 123 assert_throws(new TypeError(), () => { DOMMatrixReadOnly.fromFloat64Array(new
Float64Array([1, 2, 3, 4, 5, 6 ,7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17])); }, | 161 assert_throws(new TypeError(), () => { DOMMatrixReadOnly.fromFloat64Array(new
Float64Array([1, 2, 3, 4, 5, 6 ,7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17])); }, |
| 124 "fromFloat64Array function only accepts 1 Float64Array with 6 or 16 elements
."); | 162 "fromFloat64Array function only accepts 1 Float64Array with 6 or 16 elements
"); |
| 125 }, "DOMMatrixReadOnly fromFloat*Array - invalid array size of nearby 16"); | 163 }, "DOMMatrixReadOnly fromFloat*Array - invalid array size of nearby 16"); |
| 126 | 164 |
| 127 test(() => { | 165 test(() => { |
| 128 assert_throws(new TypeError(), () => { DOMMatrixReadOnly.fromFloat32Array(new
Float32Array([])); }, | 166 assert_throws(new TypeError(), () => { DOMMatrixReadOnly.fromFloat32Array(new
Float32Array([])); }, |
| 129 "fromFloat32Array function only accepts 1 Float32Array with 6 or 16 elements
."); | 167 "fromFloat32Array function only accepts 1 Float32Array with 6 or 16 elements
"); |
| 130 assert_throws(new TypeError(), () => { DOMMatrixReadOnly.fromFloat64Array(new
Float64Array([])); }, | 168 assert_throws(new TypeError(), () => { DOMMatrixReadOnly.fromFloat64Array(new
Float64Array([])); }, |
| 131 "fromFloat64Array function only accepts 1 Float64Array with 6 or 16 elements
."); | 169 "fromFloat64Array function only accepts 1 Float64Array with 6 or 16 elements
"); |
| 132 assert_throws(new TypeError(), () => { DOMMatrixReadOnly.fromFloat32Array(new
Float32Array([1])); }, | 170 assert_throws(new TypeError(), () => { DOMMatrixReadOnly.fromFloat32Array(new
Float32Array([1])); }, |
| 133 "fromFloat32Array function only accepts 1 Float32Array with 6 or 16 elements
."); | 171 "fromFloat32Array function only accepts 1 Float32Array with 6 or 16 elements
"); |
| 134 assert_throws(new TypeError(), () => { DOMMatrixReadOnly.fromFloat64Array(new
Float64Array([1])); }, | 172 assert_throws(new TypeError(), () => { DOMMatrixReadOnly.fromFloat64Array(new
Float64Array([1])); }, |
| 135 "fromFloat64Array function only accepts 1 Float64Array with 6 or 16 elements
."); | 173 "fromFloat64Array function only accepts 1 Float64Array with 6 or 16 elements
"); |
| 136 assert_throws(new TypeError(), () => { DOMMatrixReadOnly.fromFloat32Array(new
Float32Array(65536)); }, | 174 assert_throws(new TypeError(), () => { DOMMatrixReadOnly.fromFloat32Array(new
Float32Array(65536)); }, |
| 137 "fromFloat32Array function only accepts 1 Float32Array with 6 or 16 elements
."); | 175 "fromFloat32Array function only accepts 1 Float32Array with 6 or 16 elements
"); |
| 138 assert_throws(new TypeError(), () => { DOMMatrixReadOnly.fromFloat64Array(new
Float64Array(65536)); }, | 176 assert_throws(new TypeError(), () => { DOMMatrixReadOnly.fromFloat64Array(new
Float64Array(65536)); }, |
| 139 "fromFloat64Array function only accepts 1 Float64Array with 6 or 16 elements
."); | 177 "fromFloat64Array function only accepts 1 Float64Array with 6 or 16 elements
"); |
| 140 }, "DOMMatrixReadOnly fromFloat*Array - invalid array size"); | 178 }, "DOMMatrixReadOnly fromFloat*Array - invalid array size"); |
| 141 | 179 |
| 142 test(() => { | 180 test(() => { |
| 143 var matrix = DOMMatrixReadOnly.fromMatrix(); | 181 var matrix = DOMMatrixReadOnly.fromMatrix(); |
| 144 assert_identity_2d_matrix(matrix); | 182 assert_identity_2d_matrix(matrix); |
| 145 }, "DOMMatrixReadOnly.fromMatrix() with no parameter."); | 183 }, "DOMMatrixReadOnly.fromMatrix() with no parameter"); |
| 146 | 184 |
| 147 test(() => { | 185 test(() => { |
| 148 var matrix = DOMMatrixReadOnly.fromMatrix(null); | 186 var matrix = DOMMatrixReadOnly.fromMatrix(null); |
| 149 assert_identity_2d_matrix(matrix); | 187 assert_identity_2d_matrix(matrix); |
| 150 }, "DOMMatrixReadOnly.fromMatrix() with null."); | 188 }, "DOMMatrixReadOnly.fromMatrix() with null"); |
| 151 | 189 |
| 152 test(() => { | 190 test(() => { |
| 153 var matrix = DOMMatrixReadOnly.fromMatrix(undefined); | 191 var matrix = DOMMatrixReadOnly.fromMatrix(undefined); |
| 154 assert_identity_2d_matrix(matrix); | 192 assert_identity_2d_matrix(matrix); |
| 155 }, "DOMMatrixReadOnly.fromMatrix() with undefined."); | 193 }, "DOMMatrixReadOnly.fromMatrix() with undefined"); |
| 156 | 194 |
| 157 test(() => { | 195 test(() => { |
| 158 var matrix = DOMMatrixReadOnly.fromMatrix({}); | 196 var matrix = DOMMatrixReadOnly.fromMatrix({}); |
| 159 assert_identity_2d_matrix(matrix); | 197 assert_identity_2d_matrix(matrix); |
| 160 }, "DOMMatrixReadOnly.fromMatrix() with empty object."); | 198 }, "DOMMatrixReadOnly.fromMatrix() with empty object"); |
| 161 | 199 |
| 162 test(() => { | 200 test(() => { |
| 163 var matrix = DOMMatrixReadOnly.fromMatrix({a: 1, b: 2, c: 3, d: 4, e: 5, f: 6}
); | 201 var matrix = DOMMatrixReadOnly.fromMatrix({a: 1, b: 2, c: 3, d: 4, e: 5, f: 6}
); |
| 164 assert_2d_matrix_equals(matrix, [1, 2, 3, 4, 5, 6]); | 202 assert_2d_matrix_equals(matrix, [1, 2, 3, 4, 5, 6]); |
| 165 }, "DOMMatrixReadOnly.fromMatrix({a: 1, b: 2, c: 3, d: 4, e: 5, f: 6}) should cr
eate a 2D DOMMatrixReadOnly."); | 203 }, "DOMMatrixReadOnly.fromMatrix({a: 1, b: 2, c: 3, d: 4, e: 5, f: 6}) should cr
eate a 2D DOMMatrixReadOnly"); |
| 166 | 204 |
| 167 test(() => { | 205 test(() => { |
| 168 var matrix = DOMMatrixReadOnly.fromMatrix({m11: 1, m22: 2, m33: 3, m44: 4, m23
: 5, m43: 6}); | 206 var matrix = DOMMatrixReadOnly.fromMatrix({m11: 1, m22: 2, m33: 3, m44: 4, m23
: 5, m43: 6}); |
| 169 assert_3d_matrix_equals(matrix, [1, 0, 0, 0, 0, 2, 5, 0, 0, 0, 3, 0, 0, 0, 6,
4]); | 207 assert_3d_matrix_equals(matrix, [1, 0, 0, 0, 0, 2, 5, 0, 0, 0, 3, 0, 0, 0, 6,
4]); |
| 170 }, "DOMMatrixReadOnly.fromMatrix({m11: 1, m22: 2, m33: 3, m44: 4, m23: 5, m43: 6
}) should create a 3D DOMMatrixReadOnly."); | 208 }, "DOMMatrixReadOnly.fromMatrix({m11: 1, m22: 2, m33: 3, m44: 4, m23: 5, m43: 6
}) should create a 3D DOMMatrixReadOnly"); |
| 171 | 209 |
| 172 test(() => { | 210 test(() => { |
| 173 var matrix = DOMMatrixReadOnly.fromMatrix({a: 7, c: 9}); | 211 var matrix = DOMMatrixReadOnly.fromMatrix({a: 7, c: 9}); |
| 174 assert_2d_matrix_equals(matrix, [7, 0, 9, 1, 0, 0]); | 212 assert_2d_matrix_equals(matrix, [7, 0, 9, 1, 0, 0]); |
| 175 }, "If 2d related properties don't be set, should set to fallback."); | 213 }, "If 2d related properties don't be set, should set to fallback"); |
| 176 | 214 |
| 177 test(() => { | 215 test(() => { |
| 178 var matrix = DOMMatrixReadOnly.fromMatrix({ | 216 var matrix = DOMMatrixReadOnly.fromMatrix({ |
| 179 m11: NaN, m12: NaN, m13: NaN, m14: NaN, | 217 m11: NaN, m12: NaN, m13: NaN, m14: NaN, |
| 180 m21: NaN, m22: NaN, m23: NaN, m24: NaN, | 218 m21: NaN, m22: NaN, m23: NaN, m24: NaN, |
| 181 m31: NaN, m32: NaN, m33: NaN, m34: NaN, | 219 m31: NaN, m32: NaN, m33: NaN, m34: NaN, |
| 182 m41: NaN, m42: NaN, m43: NaN, m44: NaN, | 220 m41: NaN, m42: NaN, m43: NaN, m44: NaN, |
| 183 is2D: false | 221 is2D: false |
| 184 }); | 222 }); |
| 185 assert_3d_matrix_equals(matrix, [NaN, NaN, NaN, NaN, NaN, NaN, NaN, NaN, NaN,
NaN, NaN, NaN, NaN, NaN, NaN, NaN]); | 223 assert_3d_matrix_equals(matrix, [NaN, NaN, NaN, NaN, NaN, NaN, NaN, NaN, NaN,
NaN, NaN, NaN, NaN, NaN, NaN, NaN]); |
| 186 }, "DOMMatrixReadOnly.fromMatrix(): NaN test"); | 224 }, "DOMMatrixReadOnly.fromMatrix(): NaN test"); |
| 187 | 225 |
| 188 test(() => { | 226 test(() => { |
| 189 assert_throws(new TypeError(), () => { | 227 assert_throws(new TypeError(), () => { |
| 190 DOMMatrixReadOnly.fromMatrix({a: 1, b: 2, m33: 3, m44: 4, is2D: true}); | 228 DOMMatrixReadOnly.fromMatrix({a: 1, b: 2, m33: 3, m44: 4, is2D: true}); |
| 191 }, "The 'is2D' property is set to true but the input matrix is 3d matrix."); | 229 }, "The 'is2D' property is set to true but the input matrix is 3d matrix"); |
| 192 assert_throws(new TypeError(), () => { | 230 assert_throws(new TypeError(), () => { |
| 193 DOMMatrixReadOnly.fromMatrix({a: 1, b: 2, m11: 3}); | 231 DOMMatrixReadOnly.fromMatrix({a: 1, b: 2, m11: 3}); |
| 194 }, "The 'a' property should equal the 'm11' property."); | 232 }, "The 'a' property should equal the 'm11' property"); |
| 195 }, "DOMMatrixReadOnly.fromMatrix(): Exception test."); | 233 }, "DOMMatrixReadOnly.fromMatrix(): Exception test"); |
| 196 | 234 |
| 197 </script> | 235 </script> |
| OLD | NEW |