chromium/third_party/blink/web_tests/fast/dom/geometry-interfaces-dom-matrix-readonly-skew.html

<!DOCTYPE HTML>
<script src="../../resources/testharness.js"></script>
<script src="../../resources/testharnessreport.js"></script>
<script src="./resources/geometry-interfaces-test-helpers.js"></script>
<script>
test(function() {
  var matrix2d = new DOMMatrixReadOnly([1, 2, 3, 3.1, 2, 1]);
  var skewX = matrix2d.skewX();
  assert_2d_matrix_equals(skewX, [1, 2, 3, 3.1, 2, 1]);
}, "DOMMatrixReadOnly skewX() - 2D matrix");

test(function() {
  var matrix2d = new DOMMatrixReadOnly([1, 2, 3, 3.1, 2, 1]);
  var skewX = matrix2d.skewX(45);
  assert_2d_matrix_equals(skewX, [1, 2, 4, 5.1, 2, 1]);
}, "DOMMatrixReadOnly skewX(45) - 2D matrix");

test(function() {
  var matrix3d = new DOMMatrixReadOnly([1, 2, 3, 4, 5, 6, 7, 8, 9, 10.1, 11, 12, 13, 14, 15, 16.6]);
  var skewX = matrix3d.skewX();
  assert_3d_matrix_equals(skewX, [1, 2, 3, 4, 5, 6, 7, 8, 9, 10.1, 11, 12, 13, 14, 15, 16.6]);
}, "DOMMatrixReadOnly skewX() - 3D matrix");

test(function() {
  var matrix3d = new DOMMatrixReadOnly([1, 2, 3, 4, 5, 6, 7, 8, 9, 10.1, 11, 12, 13, 14, 15, 16.6]);
  var skewX = matrix3d.skewX(45);
  assert_3d_matrix_equals(skewX, [1, 2, 3, 4, 6, 8, 10, 12, 9, 10.1, 11, 12, 13, 14, 15, 16.6]);
}, "DOMMatrixReadOnly skewX(45) - 3D matrix");

test(function() {
  var matrix2d = new DOMMatrixReadOnly([1, 2, 3, 3.1, 2, 1]);
  var skewY = matrix2d.skewY();
  assert_2d_matrix_equals(skewY, [1, 2, 3, 3.1, 2, 1]);
}, "DOMMatrixReadOnly skewY() - 2D matrix");

test(function() {
  var matrix2d = new DOMMatrixReadOnly([2, 2, 2, 2, 2, 2]);
  var skewY = matrix2d.skewY(45);
  assert_2d_matrix_equals(skewY, [4, 4, 2, 2, 2, 2]);
}, "DOMMatrixReadOnly skewY(45) - 2D matrix");

test(function() {
  var matrix3d = new DOMMatrixReadOnly([1, 2, 3, 4, 5, 6, 7, 8, 9, 10.1, 11, 12, 13, 14, 15, 16.6]);
  var skewY = matrix3d.skewY();
  assert_3d_matrix_equals(skewY, [1, 2, 3, 4, 5, 6, 7, 8, 9, 10.1, 11, 12, 13, 14, 15, 16.6]);
}, "DOMMatrixReadOnly skewY() - 3D matrix");

test(function() {
  var matrix3d = new DOMMatrixReadOnly([1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1]);
  var skewY = matrix3d.skewY(45);
  assert_3d_matrix_equals(skewY, [2, 2, 2, 2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1]);
}, "DOMMatrixReadOnly skewY(45) - 3D matrix");
</script>