Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(642)

Side by Side Diff: third_party/WebKit/LayoutTests/fast/dom/geometry-interfaces-dom-matrix-skew.html

Issue 2283173003: Implement inverse & invertSelf function in DOMMatrix & DOMMatrixReadOnly. (Closed)
Patch Set: Implement inverse & invertSelf funtion in DomMatrix & DOMMatrixReadOnly. Created 4 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 <!DOCTYPE HTML> 1 <!DOCTYPE HTML>
2 <html> 2 <html>
3 <head> 3 <head>
4 <title>Geometry Interfaces: DOMMatrix skew</title> 4 <title>Geometry Interfaces: DOMMatrix skew</title>
5 <script src="../../resources/testharness.js"></script> 5 <script src="../../resources/testharness.js"></script>
6 <script src="../../resources/testharnessreport.js"></script> 6 <script src="../../resources/testharnessreport.js"></script>
7 </head> 7 </head>
8 <body> 8 <body>
9 <script> 9 <script>
10 test(function() { 10 test(function() {
11 /* TODO create the DOMMatrix directly when the sequence constructor is suppo rted. */
11 var matrix2d = new DOMMatrix(new DOMMatrixReadOnly([1, 2, 3, 3.1, 2, 1])); 12 var matrix2d = new DOMMatrix(new DOMMatrixReadOnly([1, 2, 3, 3.1, 2, 1]));
12 matrix2d.skewXSelf(); 13 matrix2d.skewXSelf();
13 assert_true(matrix2d.is2D); 14 assert_true(matrix2d.is2D);
14 assert_equals(matrix2d.a, 1); 15 assert_equals(matrix2d.a, 1);
15 assert_equals(matrix2d.b, 2); 16 assert_equals(matrix2d.b, 2);
16 assert_equals(matrix2d.c, 3); 17 assert_equals(matrix2d.c, 3);
17 assert_equals(matrix2d.d, 3.1); 18 assert_equals(matrix2d.d, 3.1);
18 assert_equals(matrix2d.e, 2); 19 assert_equals(matrix2d.e, 2);
19 assert_equals(matrix2d.f, 1); 20 assert_equals(matrix2d.f, 1);
20 }, "DOMMatrix skewX() - 2D matrix"); 21 }, "DOMMatrix skewX() - 2D matrix");
21 22
22 test(function() { 23 test(function() {
24 /* TODO create the DOMMatrix directly when the sequence constructor is suppo rted. */
23 var matrix2d = new DOMMatrix(new DOMMatrixReadOnly([1, 2, 3, 3.1, 2, 1])); 25 var matrix2d = new DOMMatrix(new DOMMatrixReadOnly([1, 2, 3, 3.1, 2, 1]));
24 matrix2d.skewXSelf(45); 26 matrix2d.skewXSelf(45);
25 assert_true(matrix2d.is2D); 27 assert_true(matrix2d.is2D);
26 assert_equals(matrix2d.a, 1); 28 assert_equals(matrix2d.a, 1);
27 assert_equals(matrix2d.b, 2); 29 assert_equals(matrix2d.b, 2);
28 assert_equals(matrix2d.c, 4); 30 assert_equals(matrix2d.c, 4);
29 assert_equals(matrix2d.d, 5.1); 31 assert_equals(matrix2d.d, 5.1);
30 assert_equals(matrix2d.e, 2); 32 assert_equals(matrix2d.e, 2);
31 assert_equals(matrix2d.f, 1); 33 assert_equals(matrix2d.f, 1);
32 }, "DOMMatrix skewX(45) - 2D matrix"); 34 }, "DOMMatrix skewX(45) - 2D matrix");
33 35
34 test(function() { 36 test(function() {
37 /* TODO create the DOMMatrix directly when the sequence constructor is suppo rted. */
35 var matrix3d = new DOMMatrix(new DOMMatrixReadOnly([1, 2, 3, 4, 5, 6, 7, 8, 9, 10.1, 11, 12, 13, 14, 15, 16.6])); 38 var matrix3d = new DOMMatrix(new DOMMatrixReadOnly([1, 2, 3, 4, 5, 6, 7, 8, 9, 10.1, 11, 12, 13, 14, 15, 16.6]));
36 matrix3d.skewXSelf(); 39 matrix3d.skewXSelf();
37 assert_false(matrix3d.is2D); 40 assert_false(matrix3d.is2D);
38 assert_equals(matrix3d.m11, 1); 41 assert_equals(matrix3d.m11, 1);
39 assert_equals(matrix3d.m12, 2); 42 assert_equals(matrix3d.m12, 2);
40 assert_equals(matrix3d.m13, 3); 43 assert_equals(matrix3d.m13, 3);
41 assert_equals(matrix3d.m14, 4); 44 assert_equals(matrix3d.m14, 4);
42 assert_equals(matrix3d.m21, 5); 45 assert_equals(matrix3d.m21, 5);
43 assert_equals(matrix3d.m22, 6); 46 assert_equals(matrix3d.m22, 6);
44 assert_equals(matrix3d.m23, 7); 47 assert_equals(matrix3d.m23, 7);
45 assert_equals(matrix3d.m24, 8); 48 assert_equals(matrix3d.m24, 8);
46 assert_equals(matrix3d.m31, 9); 49 assert_equals(matrix3d.m31, 9);
47 assert_equals(matrix3d.m32, 10.1); 50 assert_equals(matrix3d.m32, 10.1);
48 assert_equals(matrix3d.m33, 11); 51 assert_equals(matrix3d.m33, 11);
49 assert_equals(matrix3d.m34, 12); 52 assert_equals(matrix3d.m34, 12);
50 assert_equals(matrix3d.m41, 13); 53 assert_equals(matrix3d.m41, 13);
51 assert_equals(matrix3d.m42, 14); 54 assert_equals(matrix3d.m42, 14);
52 assert_equals(matrix3d.m43, 15); 55 assert_equals(matrix3d.m43, 15);
53 assert_equals(matrix3d.m44, 16.6); 56 assert_equals(matrix3d.m44, 16.6);
54 }, "DOMMatrix skewX() - 3D matrix"); 57 }, "DOMMatrix skewX() - 3D matrix");
55 58
56 test(function() { 59 test(function() {
60 /* TODO create the DOMMatrix directly when the sequence constructor is suppo rted. */
57 var matrix3d = new DOMMatrix(new DOMMatrixReadOnly([1, 2, 3, 4, 5, 6, 7, 8, 9, 10.1, 11, 12, 13, 14, 15, 16.6])); 61 var matrix3d = new DOMMatrix(new DOMMatrixReadOnly([1, 2, 3, 4, 5, 6, 7, 8, 9, 10.1, 11, 12, 13, 14, 15, 16.6]));
58 matrix3d.skewXSelf(45); 62 matrix3d.skewXSelf(45);
59 assert_false(matrix3d.is2D); 63 assert_false(matrix3d.is2D);
60 assert_equals(matrix3d.m11, 1); 64 assert_equals(matrix3d.m11, 1);
61 assert_equals(matrix3d.m12, 2); 65 assert_equals(matrix3d.m12, 2);
62 assert_equals(matrix3d.m13, 3); 66 assert_equals(matrix3d.m13, 3);
63 assert_equals(matrix3d.m14, 4); 67 assert_equals(matrix3d.m14, 4);
64 assert_equals(matrix3d.m21, 6); 68 assert_equals(matrix3d.m21, 6);
65 assert_equals(matrix3d.m22, 8); 69 assert_equals(matrix3d.m22, 8);
66 assert_equals(matrix3d.m23, 10); 70 assert_equals(matrix3d.m23, 10);
67 assert_equals(matrix3d.m24, 12); 71 assert_equals(matrix3d.m24, 12);
68 assert_equals(matrix3d.m31, 9); 72 assert_equals(matrix3d.m31, 9);
69 assert_equals(matrix3d.m32, 10.1); 73 assert_equals(matrix3d.m32, 10.1);
70 assert_equals(matrix3d.m33, 11); 74 assert_equals(matrix3d.m33, 11);
71 assert_equals(matrix3d.m34, 12); 75 assert_equals(matrix3d.m34, 12);
72 assert_equals(matrix3d.m41, 13); 76 assert_equals(matrix3d.m41, 13);
73 assert_equals(matrix3d.m42, 14); 77 assert_equals(matrix3d.m42, 14);
74 assert_equals(matrix3d.m43, 15); 78 assert_equals(matrix3d.m43, 15);
75 assert_equals(matrix3d.m44, 16.6); 79 assert_equals(matrix3d.m44, 16.6);
76 }, "DOMMatrix skewX(45) - 3D matrix"); 80 }, "DOMMatrix skewX(45) - 3D matrix");
77 81
78 test(function() { 82 test(function() {
83 /* TODO create the DOMMatrix directly when the sequence constructor is suppo rted. */
79 var matrix2d = new DOMMatrix(new DOMMatrixReadOnly([1, 2, 3, 3.1, 2, 1])); 84 var matrix2d = new DOMMatrix(new DOMMatrixReadOnly([1, 2, 3, 3.1, 2, 1]));
80 matrix2d.skewYSelf(); 85 matrix2d.skewYSelf();
81 assert_true(matrix2d.is2D); 86 assert_true(matrix2d.is2D);
82 assert_equals(matrix2d.a, 1); 87 assert_equals(matrix2d.a, 1);
83 assert_equals(matrix2d.b, 2); 88 assert_equals(matrix2d.b, 2);
84 assert_equals(matrix2d.c, 3); 89 assert_equals(matrix2d.c, 3);
85 assert_equals(matrix2d.d, 3.1); 90 assert_equals(matrix2d.d, 3.1);
86 assert_equals(matrix2d.e, 2); 91 assert_equals(matrix2d.e, 2);
87 assert_equals(matrix2d.f, 1); 92 assert_equals(matrix2d.f, 1);
88 }, "DOMMatrix skewY() - 2D matrix"); 93 }, "DOMMatrix skewY() - 2D matrix");
89 94
90 test(function() { 95 test(function() {
96 /* TODO create the DOMMatrix directly when the sequence constructor is suppo rted. */
91 var matrix2d = new DOMMatrix(new DOMMatrixReadOnly([2, 2, 2, 2, 2, 2])); 97 var matrix2d = new DOMMatrix(new DOMMatrixReadOnly([2, 2, 2, 2, 2, 2]));
92 matrix2d.skewYSelf(45); 98 matrix2d.skewYSelf(45);
93 assert_true(matrix2d.is2D); 99 assert_true(matrix2d.is2D);
94 assert_equals(matrix2d.a, 4); 100 assert_equals(matrix2d.a, 4);
95 assert_equals(matrix2d.b, 4); 101 assert_equals(matrix2d.b, 4);
96 assert_equals(matrix2d.c, 2); 102 assert_equals(matrix2d.c, 2);
97 assert_equals(matrix2d.d, 2); 103 assert_equals(matrix2d.d, 2);
98 assert_equals(matrix2d.e, 2); 104 assert_equals(matrix2d.e, 2);
99 assert_equals(matrix2d.f, 2); 105 assert_equals(matrix2d.f, 2);
100 }, "DOMMatrix skewY(45) - 2D matrix"); 106 }, "DOMMatrix skewY(45) - 2D matrix");
101 107
102 test(function() { 108 test(function() {
109 /* TODO create the DOMMatrix directly when the sequence constructor is suppo rted. */
103 var matrix3d = new DOMMatrix(new DOMMatrixReadOnly([1, 2, 3, 4, 5, 6, 7, 8, 9, 10.1, 11, 12, 13, 14, 15, 16.6])); 110 var matrix3d = new DOMMatrix(new DOMMatrixReadOnly([1, 2, 3, 4, 5, 6, 7, 8, 9, 10.1, 11, 12, 13, 14, 15, 16.6]));
104 matrix3d.skewYSelf(); 111 matrix3d.skewYSelf();
105 assert_false(matrix3d.is2D); 112 assert_false(matrix3d.is2D);
106 assert_equals(matrix3d.m11, 1); 113 assert_equals(matrix3d.m11, 1);
107 assert_equals(matrix3d.m12, 2); 114 assert_equals(matrix3d.m12, 2);
108 assert_equals(matrix3d.m13, 3); 115 assert_equals(matrix3d.m13, 3);
109 assert_equals(matrix3d.m14, 4); 116 assert_equals(matrix3d.m14, 4);
110 assert_equals(matrix3d.m21, 5); 117 assert_equals(matrix3d.m21, 5);
111 assert_equals(matrix3d.m22, 6); 118 assert_equals(matrix3d.m22, 6);
112 assert_equals(matrix3d.m23, 7); 119 assert_equals(matrix3d.m23, 7);
113 assert_equals(matrix3d.m24, 8); 120 assert_equals(matrix3d.m24, 8);
114 assert_equals(matrix3d.m31, 9); 121 assert_equals(matrix3d.m31, 9);
115 assert_equals(matrix3d.m32, 10.1); 122 assert_equals(matrix3d.m32, 10.1);
116 assert_equals(matrix3d.m33, 11); 123 assert_equals(matrix3d.m33, 11);
117 assert_equals(matrix3d.m34, 12); 124 assert_equals(matrix3d.m34, 12);
118 assert_equals(matrix3d.m41, 13); 125 assert_equals(matrix3d.m41, 13);
119 assert_equals(matrix3d.m42, 14); 126 assert_equals(matrix3d.m42, 14);
120 assert_equals(matrix3d.m43, 15); 127 assert_equals(matrix3d.m43, 15);
121 assert_equals(matrix3d.m44, 16.6); 128 assert_equals(matrix3d.m44, 16.6);
122 }, "DOMMatrix skewY() - 3D matrix"); 129 }, "DOMMatrix skewY() - 3D matrix");
123 130
124 test(function() { 131 test(function() {
132 /* TODO create the DOMMatrix directly when the sequence constructor is suppo rted. */
125 var matrix3d = new DOMMatrix(new DOMMatrixReadOnly([1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1])); 133 var matrix3d = new DOMMatrix(new DOMMatrixReadOnly([1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1]));
126 matrix3d.skewYSelf(45); 134 matrix3d.skewYSelf(45);
127 assert_false(matrix3d.is2D); 135 assert_false(matrix3d.is2D);
128 assert_equals(matrix3d.m11, 2); 136 assert_equals(matrix3d.m11, 2);
129 assert_equals(matrix3d.m12, 2); 137 assert_equals(matrix3d.m12, 2);
130 assert_equals(matrix3d.m13, 2); 138 assert_equals(matrix3d.m13, 2);
131 assert_equals(matrix3d.m14, 2); 139 assert_equals(matrix3d.m14, 2);
132 assert_equals(matrix3d.m21, 1); 140 assert_equals(matrix3d.m21, 1);
133 assert_equals(matrix3d.m22, 1); 141 assert_equals(matrix3d.m22, 1);
134 assert_equals(matrix3d.m23, 1); 142 assert_equals(matrix3d.m23, 1);
135 assert_equals(matrix3d.m24, 1); 143 assert_equals(matrix3d.m24, 1);
136 assert_equals(matrix3d.m31, 1); 144 assert_equals(matrix3d.m31, 1);
137 assert_equals(matrix3d.m32, 1); 145 assert_equals(matrix3d.m32, 1);
138 assert_equals(matrix3d.m33, 1); 146 assert_equals(matrix3d.m33, 1);
139 assert_equals(matrix3d.m34, 1); 147 assert_equals(matrix3d.m34, 1);
140 assert_equals(matrix3d.m41, 1); 148 assert_equals(matrix3d.m41, 1);
141 assert_equals(matrix3d.m42, 1); 149 assert_equals(matrix3d.m42, 1);
142 assert_equals(matrix3d.m43, 1); 150 assert_equals(matrix3d.m43, 1);
143 assert_equals(matrix3d.m44, 1); 151 assert_equals(matrix3d.m44, 1);
144 }, "DOMMatrix skewY(45) - 3D matrix"); 152 }, "DOMMatrix skewY(45) - 3D matrix");
145 </script> 153 </script>
146 </body> 154 </body>
147 </html> 155 </html>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698