@@ -320,4 +320,207 @@ public void contructorEmptyArray() throws Exception {
320320
321321 loadPageVerifyTitle2 (html );
322322 }
323+ /**
324+ * @throws Exception on test failure
325+ */
326+ @ Test
327+ @ Alerts ({"[-1, 0, 0, 1, 0, 0]" ,
328+ "true" })
329+ public void flipX_identity () throws Exception {
330+ final String html = DOCTYPE_HTML
331+ + "<html>\n "
332+ + "<body>\n "
333+ + "<script>\n "
334+ + LOG_TITLE_FUNCTION
335+ + DUMP_2D_FUNCTION
336+ + "let m = new DOMMatrixReadOnly();\n "
337+ + "let flipped = m.flipX();\n "
338+ + "dump(flipped);\n "
339+ + "</script>\n "
340+ + "</body></html>" ;
341+
342+ loadPageVerifyTitle2 (html );
343+ }
344+
345+ /**
346+ * @throws Exception on test failure
347+ */
348+ @ Test
349+ @ Alerts ({"[1, 0, 0, -1, 0, 0]" ,
350+ "true" })
351+ public void flipY_identity () throws Exception {
352+ final String html = DOCTYPE_HTML
353+ + "<html>\n "
354+ + "<body>\n "
355+ + "<script>\n "
356+ + LOG_TITLE_FUNCTION
357+ + DUMP_2D_FUNCTION
358+ + "let m = new DOMMatrixReadOnly();\n "
359+ + "let flipped = m.flipY();\n "
360+ + "dump(flipped);\n "
361+ + "</script>\n "
362+ + "</body></html>" ;
363+
364+ loadPageVerifyTitle2 (html );
365+ }
366+
367+ /**
368+ * @throws Exception on test failure
369+ */
370+ @ Test
371+ @ Alerts (DEFAULT = {"[NaN, 0, 0, 1, 0, 0]" ,
372+ "true" },
373+ FF = {"[NaN, 0, NaN, 1, NaN, 0]" ,
374+ "true" },
375+ FF_ESR = {"[NaN, 0, NaN, 1, NaN, 0]" ,
376+ "true" })
377+ @ HtmlUnitNYI (FF = {"[NaN, 0, 0, 1, 0, 0]" ,
378+ "true" },
379+ FF_ESR = {"[NaN, 0, 0, 1, 0, 0]" ,
380+ "true" })
381+ public void flipX_NaN () throws Exception {
382+ final String html = DOCTYPE_HTML
383+ + "<html>\n "
384+ + "<body>\n "
385+ + "<script>\n "
386+ + LOG_TITLE_FUNCTION
387+ + DUMP_2D_FUNCTION
388+ + "let m = new DOMMatrixReadOnly([NaN, 0, 0, 1, 0, 0]);\n "
389+ + "let flipped = m.flipX();\n "
390+ + "dump(flipped);\n "
391+ + "</script>\n "
392+ + "</body></html>" ;
393+
394+ loadPageVerifyTitle2 (html );
395+ }
396+
397+ /**
398+ * @throws Exception on test failure
399+ */
400+ @ Test
401+ @ Alerts (DEFAULT = {"[1, 0, 0, -Infinity, 0, 0]" ,
402+ "true" },
403+ FF = {"[1, NaN, 0, -Infinity, 0, NaN]" ,
404+ "true" },
405+ FF_ESR = {"[1, NaN, 0, -Infinity, 0, NaN]" ,
406+ "true" })
407+ @ HtmlUnitNYI (FF = {"[1, 0, 0, -Infinity, 0, 0]" ,
408+ "true" },
409+ FF_ESR = {"[1, 0, 0, -Infinity, 0, 0]" ,
410+ "true" })
411+ public void flipY_Infinity () throws Exception {
412+ final String html = DOCTYPE_HTML
413+ + "<html>\n "
414+ + "<body>\n "
415+ + "<script>\n "
416+ + LOG_TITLE_FUNCTION
417+ + DUMP_2D_FUNCTION
418+ + "let m = new DOMMatrixReadOnly([1, 0, 0, Infinity, 0, 0]);\n "
419+ + "let flipped = m.flipY();\n "
420+ + "dump(flipped);\n "
421+ + "</script>\n "
422+ + "</body></html>" ;
423+
424+ loadPageVerifyTitle2 (html );
425+ }
426+ /**
427+ * @throws Exception on test failure
428+ */
429+ @ Test
430+ @ Alerts ({"[-2, -3, 4, 5, 6, 7]" ,
431+ "true" ,
432+ "[2, 3, 4, 5, 6, 7]" ,
433+ "true" })
434+ public void flipX_general () throws Exception {
435+ final String html = DOCTYPE_HTML
436+ + "<html>\n "
437+ + "<body>\n "
438+ + "<script>\n "
439+ + LOG_TITLE_FUNCTION
440+ + DUMP_2D_FUNCTION
441+ + "let m = new DOMMatrixReadOnly([2, 3, 4, 5, 6, 7]);\n "
442+ + "let flipped = m.flipX();\n "
443+ + "dump(flipped);\n "
444+ + "dump(m);\n "
445+ + "</script>\n "
446+ + "</body></html>" ;
447+
448+ loadPageVerifyTitle2 (html );
449+ }
450+
451+ /**
452+ * @throws Exception on test failure
453+ */
454+ @ Test
455+ @ Alerts ({"[2, 3, -4, -5, 6, 7]" ,
456+ "true" ,
457+ "[2, 3, 4, 5, 6, 7]" ,
458+ "true" })
459+ public void flipY_general () throws Exception {
460+ final String html = DOCTYPE_HTML
461+ + "<html>\n "
462+ + "<body>\n "
463+ + "<script>\n "
464+ + LOG_TITLE_FUNCTION
465+ + DUMP_2D_FUNCTION
466+ + "let m = new DOMMatrixReadOnly([2, 3, 4, 5, 6, 7]);\n "
467+ + "let flipped = m.flipY();\n "
468+ + "dump(flipped);\n "
469+ + "dump(m);\n "
470+ + "</script>\n "
471+ + "</body></html>" ;
472+
473+ loadPageVerifyTitle2 (html );
474+ }
475+ /**
476+ * @throws Exception on test failure
477+ */
478+ @ Test
479+ @ Alerts ({"[-16, -15, 12, 11, 4, 3]" ,
480+ "1[-16, -15, -14, -13]" ,
481+ "2[12, 11, 10, 9]" ,
482+ "3[8, 7, 6, 5]" ,
483+ "4[4, 3, 2, 1]" ,
484+ "false" })
485+ public void flipX_3D () throws Exception {
486+ final String html = DOCTYPE_HTML
487+ + "<html>\n "
488+ + "<body>\n "
489+ + "<script>\n "
490+ + LOG_TITLE_FUNCTION
491+ + DUMP_FUNCTION
492+ + "let m = new DOMMatrixReadOnly([16, 15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1]);\n "
493+ + "let flipped = m.flipX();\n "
494+ + "dump(flipped);\n "
495+ + "</script>\n "
496+ + "</body></html>" ;
497+
498+ loadPageVerifyTitle2 (html );
499+ }
500+
501+ /**
502+ * @throws Exception on test failure
503+ */
504+ @ Test
505+ @ Alerts ({"[16, 15, -12, -11, 4, 3]" ,
506+ "1[16, 15, 14, 13]" ,
507+ "2[-12, -11, -10, -9]" ,
508+ "3[8, 7, 6, 5]" ,
509+ "4[4, 3, 2, 1]" ,
510+ "false" })
511+ public void flipY_3D () throws Exception {
512+ final String html = DOCTYPE_HTML
513+ + "<html>\n "
514+ + "<body>\n "
515+ + "<script>\n "
516+ + LOG_TITLE_FUNCTION
517+ + DUMP_FUNCTION
518+ + "let m = new DOMMatrixReadOnly([16, 15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1]);\n "
519+ + "let flipped = m.flipY();\n "
520+ + "dump(flipped);\n "
521+ + "</script>\n "
522+ + "</body></html>" ;
523+
524+ loadPageVerifyTitle2 (html );
525+ }
323526}
0 commit comments