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

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

Issue 2260423002: Implement skew* funtion in DomMatrix & DOMMatrixReadOnly. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix a typo Created 4 years, 4 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
(Empty)
1 <!DOCTYPE HTML>
2 <html>
3 <head>
4 <title>Geometry Interfaces: DOMMatrix skew</title>
5 <script src="../../resources/testharness.js"></script>
6 <script src="../../resources/testharnessreport.js"></script>
7 </head>
8 <body>
9 <script>
10 test(function() {
11 var matrix2d = new DOMMatrix(new DOMMatrixReadOnly([1, 2, 3, 3.1, 2, 1]));
12 matrix2d.skewXSelf();
13 assert_true(matrix2d.is2D);
14 assert_equals(matrix2d.a, 1);
15 assert_equals(matrix2d.b, 2);
16 assert_equals(matrix2d.c, 3);
17 assert_equals(matrix2d.d, 3.1);
18 assert_equals(matrix2d.e, 2);
19 assert_equals(matrix2d.f, 1);
20 }, "DOMMatrix skewX() - 2D matrix");
21
22 test(function() {
23 var matrix2d = new DOMMatrix(new DOMMatrixReadOnly([1, 2, 3, 3.1, 2, 1]));
24 matrix2d.skewXSelf(45);
25 assert_true(matrix2d.is2D);
26 assert_equals(matrix2d.a, 1);
27 assert_equals(matrix2d.b, 2);
28 assert_equals(matrix2d.c, 4);
29 assert_equals(matrix2d.d, 5.1);
30 assert_equals(matrix2d.e, 2);
31 assert_equals(matrix2d.f, 1);
32 }, "DOMMatrix skewX(45) - 2D matrix");
33
34 test(function() {
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]));
36 matrix3d.skewXSelf();
37 assert_false(matrix3d.is2D);
38 assert_equals(matrix3d.m11, 1);
39 assert_equals(matrix3d.m12, 2);
40 assert_equals(matrix3d.m13, 3);
41 assert_equals(matrix3d.m14, 4);
42 assert_equals(matrix3d.m21, 5);
43 assert_equals(matrix3d.m22, 6);
44 assert_equals(matrix3d.m23, 7);
45 assert_equals(matrix3d.m24, 8);
46 assert_equals(matrix3d.m31, 9);
47 assert_equals(matrix3d.m32, 10.1);
48 assert_equals(matrix3d.m33, 11);
49 assert_equals(matrix3d.m34, 12);
50 assert_equals(matrix3d.m41, 13);
51 assert_equals(matrix3d.m42, 14);
52 assert_equals(matrix3d.m43, 15);
53 assert_equals(matrix3d.m44, 16.6);
54 }, "DOMMatrix skewX() - 3D matrix");
55
56 test(function() {
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]));
58 matrix3d.skewXSelf(45);
59 assert_false(matrix3d.is2D);
60 assert_equals(matrix3d.m11, 1);
61 assert_equals(matrix3d.m12, 2);
62 assert_equals(matrix3d.m13, 3);
63 assert_equals(matrix3d.m14, 4);
64 assert_equals(matrix3d.m21, 6);
65 assert_equals(matrix3d.m22, 8);
66 assert_equals(matrix3d.m23, 10);
67 assert_equals(matrix3d.m24, 12);
68 assert_equals(matrix3d.m31, 9);
69 assert_equals(matrix3d.m32, 10.1);
70 assert_equals(matrix3d.m33, 11);
71 assert_equals(matrix3d.m34, 12);
72 assert_equals(matrix3d.m41, 13);
73 assert_equals(matrix3d.m42, 14);
74 assert_equals(matrix3d.m43, 15);
75 assert_equals(matrix3d.m44, 16.6);
76 }, "DOMMatrix skewX(45) - 3D matrix");
77
78 test(function() {
79 var matrix2d = new DOMMatrix(new DOMMatrixReadOnly([1, 2, 3, 3.1, 2, 1]));
80 matrix2d.skewYSelf();
81 assert_true(matrix2d.is2D);
82 assert_equals(matrix2d.a, 1);
83 assert_equals(matrix2d.b, 2);
84 assert_equals(matrix2d.c, 3);
85 assert_equals(matrix2d.d, 3.1);
86 assert_equals(matrix2d.e, 2);
87 assert_equals(matrix2d.f, 1);
88 }, "DOMMatrix skewY() - 2D matrix");
89
90 test(function() {
91 var matrix2d = new DOMMatrix(new DOMMatrixReadOnly([2, 2, 2, 2, 2, 2]));
92 matrix2d.skewYSelf(45);
93 assert_true(matrix2d.is2D);
94 assert_equals(matrix2d.a, 4);
95 assert_equals(matrix2d.b, 4);
96 assert_equals(matrix2d.c, 2);
97 assert_equals(matrix2d.d, 2);
98 assert_equals(matrix2d.e, 2);
99 assert_equals(matrix2d.f, 2);
100 }, "DOMMatrix skewY(45) - 2D matrix");
101
102 test(function() {
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]));
104 matrix3d.skewYSelf();
105 assert_false(matrix3d.is2D);
106 assert_equals(matrix3d.m11, 1);
107 assert_equals(matrix3d.m12, 2);
108 assert_equals(matrix3d.m13, 3);
109 assert_equals(matrix3d.m14, 4);
110 assert_equals(matrix3d.m21, 5);
111 assert_equals(matrix3d.m22, 6);
112 assert_equals(matrix3d.m23, 7);
113 assert_equals(matrix3d.m24, 8);
114 assert_equals(matrix3d.m31, 9);
115 assert_equals(matrix3d.m32, 10.1);
116 assert_equals(matrix3d.m33, 11);
117 assert_equals(matrix3d.m34, 12);
118 assert_equals(matrix3d.m41, 13);
119 assert_equals(matrix3d.m42, 14);
120 assert_equals(matrix3d.m43, 15);
121 assert_equals(matrix3d.m44, 16.6);
122 }, "DOMMatrix skewY() - 3D matrix");
123
124 test(function() {
125 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);
127 assert_false(matrix3d.is2D);
128 assert_equals(matrix3d.m11, 2);
129 assert_equals(matrix3d.m12, 2);
130 assert_equals(matrix3d.m13, 2);
131 assert_equals(matrix3d.m14, 2);
132 assert_equals(matrix3d.m21, 1);
133 assert_equals(matrix3d.m22, 1);
134 assert_equals(matrix3d.m23, 1);
135 assert_equals(matrix3d.m24, 1);
136 assert_equals(matrix3d.m31, 1);
137 assert_equals(matrix3d.m32, 1);
138 assert_equals(matrix3d.m33, 1);
139 assert_equals(matrix3d.m34, 1);
140 assert_equals(matrix3d.m41, 1);
141 assert_equals(matrix3d.m42, 1);
142 assert_equals(matrix3d.m43, 1);
143 assert_equals(matrix3d.m44, 1);
144 }, "DOMMatrix skewY(45) - 3D matrix");
145 </script>
146 </body>
147 </html>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698