Move parseFontFaceDescriptor to CSSPropertyParser.cpp
[chromium-blink-merge.git] / third_party / WebKit / LayoutTests / fast / dom / geometry-interfaces-dom-matrix.html
blobf394c57d40b7fa85fa610fefe4f3edc1b449166a
1 <!DOCTYPE html>
2 <html>
3 <head>
4 <title>Geometry Interfaces: DOMMatrix</title>
5 <script src="../../resources/testharness.js"></script>
6 <script src="../../resources/testharnessreport.js"></script>
7 </head>
8 <body>
9 <script>
11 test(function() {
12 var matrix = new DOMMatrix();
13 assert_equals(matrix.m11, 1);
14 assert_equals(matrix.m12, 0);
15 assert_equals(matrix.m13, 0);
16 assert_equals(matrix.m14, 0);
17 assert_equals(matrix.m21, 0);
18 assert_equals(matrix.m22, 1);
19 assert_equals(matrix.m23, 0);
20 assert_equals(matrix.m24, 0);
21 assert_equals(matrix.m31, 0);
22 assert_equals(matrix.m32, 0);
23 assert_equals(matrix.m33, 1);
24 assert_equals(matrix.m34, 0);
25 assert_equals(matrix.m41, 0);
26 assert_equals(matrix.m42, 0);
27 assert_equals(matrix.m43, 0);
28 assert_equals(matrix.m44, 1);
29 assert_true(matrix.is2D);
30 assert_true(matrix.isIdentity);
31 }, "DOMMatrix() constructor");
33 test(function() {
34 var other = new DOMMatrix();
35 other.m11 = 10;
36 other.m12 = 20;
37 other.m24 = 2;
38 other.m33 = 3;
39 other.m42 = 3;
40 other.m44 = 9;
42 var matrix = new DOMMatrix(other);
43 assert_equals(matrix.m11, 10);
44 assert_equals(matrix.m12, 20);
45 assert_equals(matrix.m13, 0);
46 assert_equals(matrix.m14, 0);
47 assert_equals(matrix.m21, 0);
48 assert_equals(matrix.m22, 1);
49 assert_equals(matrix.m23, 0);
50 assert_equals(matrix.m24, 2);
51 assert_equals(matrix.m31, 0);
52 assert_equals(matrix.m32, 0);
53 assert_equals(matrix.m33, 3);
54 assert_equals(matrix.m34, 0);
55 assert_equals(matrix.m41, 0);
56 assert_equals(matrix.m42, 3);
57 assert_equals(matrix.m43, 0);
58 assert_equals(matrix.m44, 9);
59 assert_false(matrix.is2D);
60 assert_false(matrix.isIdentity);
61 }, "DOMMatrix(other) constructor");
63 test(function() {
64 var matrix = new DOMMatrix();
65 matrix.a = 10;
66 matrix.b = 20;
67 matrix.m24 = 2;
68 matrix.m33 = 3;
69 matrix.m42 = 3;
70 matrix.m44 = 9;
71 assert_equals(matrix.a, matrix.m11);
72 assert_equals(matrix.b, matrix.m12);
73 assert_equals(matrix.c, matrix.m21);
74 assert_equals(matrix.d, matrix.m22);
75 assert_equals(matrix.e, matrix.m41);
76 assert_equals(matrix.f, matrix.m42);
77 assert_equals(matrix.m11, 10);
78 assert_equals(matrix.m12, 20);
79 assert_equals(matrix.m13, 0);
80 assert_equals(matrix.m14, 0);
81 assert_equals(matrix.m21, 0);
82 assert_equals(matrix.m22, 1);
83 assert_equals(matrix.m23, 0);
84 assert_equals(matrix.m24, 2);
85 assert_equals(matrix.m31, 0);
86 assert_equals(matrix.m32, 0);
87 assert_equals(matrix.m33, 3);
88 assert_equals(matrix.m34, 0);
89 assert_equals(matrix.m41, 0);
90 assert_equals(matrix.m42, 3);
91 assert_equals(matrix.m43, 0);
92 assert_equals(matrix.m44, 9);
93 assert_false(matrix.is2D);
94 assert_false(matrix.isIdentity);
95 }, "DOMMatrix attributes");
97 test(function() {
98 var matrix = new DOMMatrix();
99 assert_true(matrix.is2D);
100 assert_true(matrix.isIdentity);
101 matrix.m31 = 1;
102 matrix.m33 = 0;
103 assert_false(matrix.is2D);
104 assert_false(matrix.isIdentity);
105 matrix.m31 = 0;
106 matrix.m33 = 1;
107 assert_false(matrix.is2D);
108 assert_true(matrix.isIdentity);
109 }, "DOMMatrix.is2D can never be set to 'true' when it was set to 'false' before calling setMatrixValue().");
111 </script>
112 </body>
113 </html>