OLD | NEW |
---|---|
1 <html xmlns="http://www.w3.org/1999/xhtml"> | 1 <html xmlns="http://www.w3.org/1999/xhtml"> |
2 <head> | 2 <head> |
3 <script src="../resources/js-test.js"></script> | 3 <script src="../resources/js-test.js"></script> |
4 </head> | 4 </head> |
5 <body> | 5 <body> |
6 <div id="description"></div> | 6 <div id="description"></div> |
7 <div id="console"></div> | 7 <div id="console"></div> |
8 | 8 |
9 <script> | 9 <script> |
10 | 10 |
(...skipping 237 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
248 shouldBe('sx.b', '0'); | 248 shouldBe('sx.b', '0'); |
249 shouldBe('sx.c', '0'); | 249 shouldBe('sx.c', '0'); |
250 shouldBe('sx.d', '1'); | 250 shouldBe('sx.d', '1'); |
251 shouldBe('sx.e', '0'); | 251 shouldBe('sx.e', '0'); |
252 shouldBe('sx.f', '0'); | 252 shouldBe('sx.f', '0'); |
253 | 253 |
254 debug(""); | 254 debug(""); |
255 debug("Test multiply with missing argument"); | 255 debug("Test multiply with missing argument"); |
256 m = new WebKitCSSMatrix("matrix(1, 2, 3, 4, 5, 6)"); | 256 m = new WebKitCSSMatrix("matrix(1, 2, 3, 4, 5, 6)"); |
257 m2 = m.multiply(); | 257 m2 = m.multiply(); |
258 shouldBe('m2', 'null'); | 258 shouldBe('m2.a', '1'); |
259 shouldBe('m2.b', '2'); | |
260 shouldBe('m2.c', '3'); | |
261 shouldBe('m2.d', '4'); | |
262 shouldBe('m2.e', '5'); | |
263 shouldBe('m2.f', '6'); | |
259 | 264 |
260 debug(""); | 265 debug(""); |
261 debug("Test inverse"); | 266 debug("Test inverse"); |
262 m = new WebKitCSSMatrix("matrix(2, 0, 0, 2, 10, 20)"); | 267 m = new WebKitCSSMatrix("matrix(2, 0, 0, 2, 10, 20)"); |
263 m2 = m.inverse(); | 268 m2 = m.inverse(); |
264 | 269 |
265 shouldBe('parseFloat(m2.a)', '0.5'); | 270 shouldBe('parseFloat(m2.a)', '0.5'); |
266 shouldBe('parseFloat(m2.b)', '0'); | 271 shouldBe('parseFloat(m2.b)', '0'); |
267 shouldBe('parseFloat(m2.c)', '0'); | 272 shouldBe('parseFloat(m2.c)', '0'); |
268 shouldBe('parseFloat(m2.d)', '0.5'); | 273 shouldBe('parseFloat(m2.d)', '0.5'); |
269 shouldBe('parseFloat(m2.e)', '-5'); | 274 shouldBe('parseFloat(m2.e)', '-5'); |
270 shouldBe('parseFloat(m2.f)', '-10'); | 275 shouldBe('parseFloat(m2.f)', '-10'); |
271 | 276 |
272 debug(""); | 277 debug(""); |
273 debug("Test immutability of inverse"); | 278 debug("Test immutability of inverse"); |
274 shouldBe('parseFloat(m.a)', '2'); | 279 shouldBe('parseFloat(m.a)', '2'); |
275 shouldBe('parseFloat(m.b)', '0'); | 280 shouldBe('parseFloat(m.b)', '0'); |
276 shouldBe('parseFloat(m.c)', '0'); | 281 shouldBe('parseFloat(m.c)', '0'); |
277 shouldBe('parseFloat(m.d)', '2'); | 282 shouldBe('parseFloat(m.d)', '2'); |
278 shouldBe('parseFloat(m.e)', '10'); | 283 shouldBe('parseFloat(m.e)', '10'); |
279 shouldBe('parseFloat(m.f)', '20'); | 284 shouldBe('parseFloat(m.f)', '20'); |
280 | 285 |
281 debug(""); | 286 debug(""); |
282 debug("Test throwing exception from inverse"); | 287 debug("Test not invertible matrix"); |
zino
2017/05/15 19:07:35
Test for non-invertible matrix.
| |
283 m = new WebKitCSSMatrix("matrix(0, 0, 0, 0, 0, 0)"); // not invertible | 288 m = new WebKitCSSMatrix("matrix(0, 0, 0, 0, 0, 0)"); // not invertible |
284 shouldThrow('m.inverse()'); | 289 m2 = m.inverse(); |
290 | |
291 shouldBeNaN('m2.a'); | |
292 shouldBeNaN('m2.b'); | |
293 shouldBeNaN('m2.c'); | |
294 shouldBeNaN('m2.d'); | |
295 shouldBeNaN('m2.e'); | |
296 shouldBeNaN('m2.f'); | |
297 | |
298 debug(""); | |
299 debug("Test immutability of inverse"); | |
300 shouldBe('m.a', '0'); | |
301 shouldBe('m.b', '0'); | |
302 shouldBe('m.c', '0'); | |
303 shouldBe('m.d', '0'); | |
304 shouldBe('m.e', '0'); | |
305 shouldBe('m.f', '0'); | |
285 | 306 |
286 debug(""); | 307 debug(""); |
287 | 308 |
288 </script> | 309 </script> |
289 | 310 |
290 <script> | 311 <script> |
291 </script> | 312 </script> |
292 | 313 |
293 </body> | 314 </body> |
294 </html> | 315 </html> |
OLD | NEW |