| OLD | NEW |
| 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 EPSILON = 1e-6; // float epsilon | 6 var EPSILON = 1e-6; // float epsilon |
| 7 | 7 |
| 8 function angle(deg) { return new CSSAngleValue(deg, 'deg'); } | 8 function angle(deg) { return new CSSAngleValue(deg, 'deg'); } |
| 9 | 9 |
| 10 function tanDegrees(degrees) { | 10 function tanDegrees(degrees) { |
| (...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 48 assert_throws(null, function() { new CSSSkew(angle(1)); }); | 48 assert_throws(null, function() { new CSSSkew(angle(1)); }); |
| 49 }, "Invalid arguments for CSSSkew throws an exception."); | 49 }, "Invalid arguments for CSSSkew throws an exception."); |
| 50 | 50 |
| 51 test(function() { | 51 test(function() { |
| 52 for (var i = 0; i < values.length; ++i) { | 52 for (var i = 0; i < values.length; ++i) { |
| 53 var input = values[i].input; | 53 var input = values[i].input; |
| 54 var inputAsMatrix = input.asMatrix(); | 54 var inputAsMatrix = input.asMatrix(); |
| 55 assert_true(inputAsMatrix.is2D()); | 55 assert_true(inputAsMatrix.is2D()); |
| 56 var tanAx = tanDegrees(input.ax.degrees); | 56 var tanAx = tanDegrees(input.ax.degrees); |
| 57 var tanAy = tanDegrees(input.ay.degrees); | 57 var tanAy = tanDegrees(input.ay.degrees); |
| 58 var expectedMatrix = new CSSMatrixTransformComponent(1, tanAy, tanAx, 1, 0,
0); | 58 var expectedMatrix = new CSSMatrixComponent(1, tanAy, tanAx, 1, 0, 0); |
| 59 for (var attribute in expectedMatrix) { | 59 for (var attribute in expectedMatrix) { |
| 60 if (typeof expectedMatrix[attribute] === "number") { | 60 if (typeof expectedMatrix[attribute] === "number") { |
| 61 assert_approx_equals(inputAsMatrix[attribute], expectedMatrix[attribute]
, EPSILON); | 61 assert_approx_equals(inputAsMatrix[attribute], expectedMatrix[attribute]
, EPSILON); |
| 62 } else { | 62 } else { |
| 63 assert_equals(inputAsMatrix[attribute], expectedMatrix[attribute]); | 63 assert_equals(inputAsMatrix[attribute], expectedMatrix[attribute]); |
| 64 } | 64 } |
| 65 } | 65 } |
| 66 } | 66 } |
| 67 }, "asMatrix is constructed correctly for CSSSkew."); | 67 }, "asMatrix is constructed correctly for CSSSkew."); |
| 68 | 68 |
| 69 </script> | 69 </script> |
| OLD | NEW |