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

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

Issue 2933473003: Remove asMatrix as a JS-exposed method in CSSTransformComponents. (Closed)
Patch Set: update skew expectation for missing "s" Created 3 years, 6 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 <script src="resources/comparisons.js"></script> 4 <script src="resources/comparisons.js"></script>
5 5
6 <script> 6 <script>
7 var EPSILON = 1e-6; // float epsilon 7 var EPSILON = 1e-6; // float epsilon
8 var testParams = [ 8 var testParams = [
9 { 9 {
10 input: new CSSScale(0, 0), 10 input: new CSSScale(0, 0),
(...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after
100 assert_throws(new TypeError(), () => { new CSSScale(NaN, 0, NaN); }); 100 assert_throws(new TypeError(), () => { new CSSScale(NaN, 0, NaN); });
101 assert_throws(new TypeError(), () => { new CSSScale(0, "hello", "world"); }); 101 assert_throws(new TypeError(), () => { new CSSScale(0, "hello", "world"); });
102 assert_throws(new TypeError(), () => { new CSSScale(0, {}, {}); }); 102 assert_throws(new TypeError(), () => { new CSSScale(0, {}, {}); });
103 assert_throws(new TypeError(), () => { new CSSScale({}, {}, {}); }); 103 assert_throws(new TypeError(), () => { new CSSScale({}, {}, {}); });
104 assert_throws(new TypeError(), () => { new CSSScale(NaN, NaN, NaN); }); 104 assert_throws(new TypeError(), () => { new CSSScale(NaN, NaN, NaN); });
105 }, "Invalid input throws an exception."); 105 }, "Invalid input throws an exception.");
106 106
107 for (let params of testParams) { 107 for (let params of testParams) {
108 test(() => { 108 test(() => {
109 var input = params.input; 109 var input = params.input;
110 var inputAsMatrix = input.asMatrix(); 110 var transformValue = new CSSTransformValue([input]);
111 assert_equals(inputAsMatrix.is2D(), input.is2D()); 111 var inputAsMatrix = transformValue.toMatrix();
112 assert_equals(inputAsMatrix.is2D, input.is2D());
112 113
113 var expectedMatrix = input.is2D() ? 114 var expectedMatrix = input.is2D() ?
114 new DOMMatrixReadOnly([input.x, 0, 0, input.y, 0, 0]) : 115 new DOMMatrixReadOnly([input.x, 0, 0, input.y, 0, 0]) :
115 new DOMMatrixReadOnly( 116 new DOMMatrixReadOnly(
116 [input.x, 0, 0, 0, 0, input.y, 0, 0, 0, 0, input.z, 0, 0, 0, 0, 1]); 117 [input.x, 0, 0, 0, 0, input.y, 0, 0, 0, 0, input.z, 0, 0, 0, 0, 1]);
117 assert_matrix_approx_equals(inputAsMatrix.matrix, expectedMatrix, EPSILON); 118 assert_matrix_approx_equals(inputAsMatrix, expectedMatrix, EPSILON);
118 }, "asMatrix is constructed correctly for " + params.cssText); 119 }, "asMatrix is constructed correctly for " + params.cssText);
119 } 120 }
120 121
121 test(() => { 122 test(() => {
122 var actual = new CSSScale(0, 0, 0); 123 var actual = new CSSScale(0, 0, 0);
123 actual.x = 1; 124 actual.x = 1;
124 actual.y = 2; 125 actual.y = 2;
125 actual.z = 3; 126 actual.z = 3;
126 assert_equals(actual.x, 1); 127 assert_equals(actual.x, 1);
127 assert_equals(actual.y, 2); 128 assert_equals(actual.y, 2);
128 assert_equals(actual.z, 3); 129 assert_equals(actual.z, 3);
129 }, "x, y, z are mutable attributes."); 130 }, "x, y, z are mutable attributes.");
130 131
131 </script> 132 </script>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698