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

Side by Side Diff: third_party/WebKit/LayoutTests/typedcssom/cssMatrix.html

Issue 2096893002: [Typed OM] Rename is2DComponent to is2D in TransformComponents (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: sync to head Created 4 years, 5 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 <script src="../resources/testharness.js"></script> 2 <script src="../resources/testharness.js"></script>
3 <script src="../resources/testharnessreport.js"></script> 3 <script src="../resources/testharnessreport.js"></script>
4 4
5 <script> 5 <script>
6 var values = [ 6 var values = [
7 {input: new CSSMatrix(0, 0, 0, 0, 0, 0), 7 {input: new CSSMatrix(0, 0, 0, 0, 0, 0),
8 a: 0, b: 0, c: 0, d: 0, e: 0, f: 0, 8 a: 0, b: 0, c: 0, d: 0, e: 0, f: 0,
9 is2DComponent: true, cssText: "matrix(0, 0, 0, 0, 0, 0)"}, 9 is2D: true, cssText: "matrix(0, 0, 0, 0, 0, 0)"},
10 {input: new CSSMatrix(2, 4, 6, 8, 10, 12), 10 {input: new CSSMatrix(2, 4, 6, 8, 10, 12),
11 a: 2, b: 4, c: 6, d: 8, e: 10, f: 12, 11 a: 2, b: 4, c: 6, d: 8, e: 10, f: 12,
12 is2DComponent: true, cssText: "matrix(2, 4, 6, 8, 10, 12)"}, 12 is2D: true, cssText: "matrix(2, 4, 6, 8, 10, 12)"},
13 {input: new CSSMatrix(-2, -4, -6, -8, -10, -12), 13 {input: new CSSMatrix(-2, -4, -6, -8, -10, -12),
14 a: -2, b: -4, c: -6, d: -8, e: -10, f: -12, 14 a: -2, b: -4, c: -6, d: -8, e: -10, f: -12,
15 is2DComponent: true, cssText: "matrix(-2, -4, -6, -8, -10, -12)"}, 15 is2D: true, cssText: "matrix(-2, -4, -6, -8, -10, -12)"},
16 {input: new CSSMatrix(1.1, -2.2, 3.3, -4.4, 5.5, 0.6), 16 {input: new CSSMatrix(1.1, -2.2, 3.3, -4.4, 5.5, 0.6),
17 a: 1.1, b: -2.2, c: 3.3, d: -4.4, e: 5.5, f: 0.6, 17 a: 1.1, b: -2.2, c: 3.3, d: -4.4, e: 5.5, f: 0.6,
18 is2DComponent: true, cssText: "matrix(1.1, -2.2, 3.3, -4.4, 5.5, 0.6)"}, 18 is2D: true, cssText: "matrix(1.1, -2.2, 3.3, -4.4, 5.5, 0.6)"},
19 {input: new CSSMatrix(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0), 19 {input: new CSSMatrix(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0),
20 m11: 0, m12: 0, m13: 0, m14: 0, m21: 0, m22: 0, m23: 0, m24: 0, 20 m11: 0, m12: 0, m13: 0, m14: 0, m21: 0, m22: 0, m23: 0, m24: 0,
21 m31: 0, m32: 0, m33: 0, m34: 0, m41: 0, m42: 0, m43: 0, m44: 0, 21 m31: 0, m32: 0, m33: 0, m34: 0, m41: 0, m42: 0, m43: 0, m44: 0,
22 is2DComponent: false, cssText: "matrix3d(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0)"}, 22 is2D: false, cssText: "matrix3d(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0)"},
23 {input: new CSSMatrix(11, 12, 13, 14, 21, 22, 23, 24, 31, 32, 33, 34, 41, 42, 43, 44), 23 {input: new CSSMatrix(11, 12, 13, 14, 21, 22, 23, 24, 31, 32, 33, 34, 41, 42, 43, 44),
24 m11: 11, m12: 12, m13: 13, m14: 14, m21: 21, m22: 22, m23: 23, m24: 24, 24 m11: 11, m12: 12, m13: 13, m14: 14, m21: 21, m22: 22, m23: 23, m24: 24,
25 m31: 31, m32: 32, m33: 33, m34: 34, m41: 41, m42: 42, m43: 43, m44: 44, 25 m31: 31, m32: 32, m33: 33, m34: 34, m41: 41, m42: 42, m43: 43, m44: 44,
26 is2DComponent: false, cssText: "matrix3d(11, 12, 13, 14, 21, 22, 23, 24, 31, 32, 33, 34, 41, 42, 43, 44)"}, 26 is2D: false, cssText: "matrix3d(11, 12, 13, 14, 21, 22, 23, 24, 31, 32, 33, 34, 41, 42, 43, 44)"},
27 {input: new CSSMatrix(1.1, 1.2, -13, -1.4, 2, 0, -2, 4, 3.1, 3, 3, 3.4, -4.1, 42, 43, 4.4), 27 {input: new CSSMatrix(1.1, 1.2, -13, -1.4, 2, 0, -2, 4, 3.1, 3, 3, 3.4, -4.1, 42, 43, 4.4),
28 m11: 1.1, m12: 1.2, m13: -13, m14: -1.4, m21: 2, m22: 0, m23: -2, m24: 4, 28 m11: 1.1, m12: 1.2, m13: -13, m14: -1.4, m21: 2, m22: 0, m23: -2, m24: 4,
29 m31: 3.1, m32: 3, m33: 3, m34: 3.4, m41: -4.1, m42: 42, m43: 43, m44: 4.4, 29 m31: 3.1, m32: 3, m33: 3, m34: 3.4, m41: -4.1, m42: 42, m43: 43, m44: 4.4,
30 is2DComponent: false, cssText: "matrix3d(1.1, 1.2, -13, -1.4, 2, 0, -2, 4, 3 .1, 3, 3, 3.4, -4.1, 42, 43, 4.4)"} 30 is2D: false, cssText: "matrix3d(1.1, 1.2, -13, -1.4, 2, 0, -2, 4, 3.1, 3, 3, 3.4, -4.1, 42, 43, 4.4)"}
31 ]; 31 ];
32 32
33 var attributeValues2D = ["a", "b", "c", "d", "e", "f"]; 33 var attributeValues2D = ["a", "b", "c", "d", "e", "f"];
34 var attributeValues3D = ["m11", "m12", "m13", "m14", "m21", "m22", "m23", "m24" , 34 var attributeValues3D = ["m11", "m12", "m13", "m14", "m21", "m22", "m23", "m24" ,
35 "m31", "m32", "m33", "m34", "m41", "m42", "m43", "m44"]; 35 "m31", "m32", "m33", "m34", "m41", "m42", "m43", "m44"];
36 36
37 test(function() { 37 test(function() {
38 for (var i = 0; i < values.length; ++i) { 38 for (var i = 0; i < values.length; ++i) {
39 var attributeValues = values[i].is2DComponent ? attributeValues2D : attribut eValues3D; 39 var attributeValues = values[i].is2D ? attributeValues2D : attributeValues3D ;
40 for (var j = 0; j < attributeValues.length; ++j) { 40 for (var j = 0; j < attributeValues.length; ++j) {
41 var attribute = attributeValues[j]; 41 var attribute = attributeValues[j];
42 assert_equals(values[i].input[attribute], values[i][attribute]); 42 assert_equals(values[i].input[attribute], values[i][attribute]);
43 } 43 }
44 } 44 }
45 }, "Test that the (a, ... , f) and (m11, ... , m44) attributes for CSSMatrix are correct."); 45 }, "Test that the (a, ... , f) and (m11, ... , m44) attributes for CSSMatrix are correct.");
46 46
47 test(function() { 47 test(function() {
48 for (var i = 0; i < values.length; ++i) { 48 for (var i = 0; i < values.length; ++i) {
49 assert_equals(values[i].input.is2DComponent(), values[i].is2DComponent); 49 assert_equals(values[i].input.is2D(), values[i].is2D);
50 } 50 }
51 }, "Test that the is2DComponent values for CSSMatrix is correct."); 51 }, "Test that the is2D values for CSSMatrix are correct.");
52 52
53 test(function() { 53 test(function() {
54 for (var i = 0; i < values.length; ++i) { 54 for (var i = 0; i < values.length; ++i) {
55 assert_equals(values[i].input.cssText, values[i].cssText); 55 assert_equals(values[i].input.cssText, values[i].cssText);
56 } 56 }
57 }, "Test that the cssText for CSSMatrix is correct."); 57 }, "Test that the cssText for CSSMatrix is correct.");
58 58
59 test(function() { 59 test(function() {
60 assert_throws(null, function() { new CSSMatrix(); }); 60 assert_throws(null, function() { new CSSMatrix(); });
61 assert_throws(null, function() { new CSSMatrix(0); }); 61 assert_throws(null, function() { new CSSMatrix(0); });
62 assert_throws(null, function() { new CSSMatrix(0, 1, 2, 3, 4); }); 62 assert_throws(null, function() { new CSSMatrix(0, 1, 2, 3, 4); });
63 assert_throws(null, function() { new CSSMatrix(0, 1, 2, 3, 4, 5, 6); }); 63 assert_throws(null, function() { new CSSMatrix(0, 1, 2, 3, 4, 5, 6); });
64 assert_throws(null, function() { new CSSMatrix(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 1 0, 11, 12, 13, 14); }); 64 assert_throws(null, function() { new CSSMatrix(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 1 0, 11, 12, 13, 14); });
65 }, "Test that invalid number of arguments for CSSMatrix throws an exception."); 65 }, "Test that invalid number of arguments for CSSMatrix throws an exception.");
66 66
67 test(function() { 67 test(function() {
68 var attributeValues = attributeValues2D.concat(attributeValues3D); 68 var attributeValues = attributeValues2D.concat(attributeValues3D);
69 for (var i = 0; i < values.length; ++i) { 69 for (var i = 0; i < values.length; ++i) {
70 var inputAsMatrix = values[i].input.asMatrix(); 70 var inputAsMatrix = values[i].input.asMatrix();
71 for (var j = 0; j < attributeValues.length; ++j) { 71 for (var j = 0; j < attributeValues.length; ++j) {
72 var attribute = attributeValues[j]; 72 var attribute = attributeValues[j];
73 assert_equals(inputAsMatrix[attribute], values[i].input[attribute]); 73 assert_equals(inputAsMatrix[attribute], values[i].input[attribute]);
74 } 74 }
75 assert_equals(inputAsMatrix.is2DComponent(), values[i].input.is2DComponent() ); 75 assert_equals(inputAsMatrix.is2D(), values[i].input.is2D());
76 assert_equals(inputAsMatrix.cssText, values[i].input.cssText); 76 assert_equals(inputAsMatrix.cssText, values[i].input.cssText);
77 } 77 }
78 }, "Test that asMatrix has all the same properties as the original CSSMatrix."); 78 }, "Test that asMatrix has all the same properties as the original CSSMatrix.");
79 79
80 </script> 80 </script>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698