blob: d2fc01470d4533c37415abc426134e1874e126f3 [file] [log] [blame]
<!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, 4, 5, 6]);
var point = matrix2d.transformPoint();
assert_dom_point_equals(point, new DOMPoint(5, 6, 0, 1));
}, "DOMMatrixReadOnly transformPoint() - 2d matrix ");
test(function() {
var matrix3d = new DOMMatrixReadOnly([1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16]);
var point = matrix3d.transformPoint();
assert_dom_point_equals(point, new DOMPoint(13, 14, 15, 16));
}, "DOMMatrixReadOnly transformPoint() - 3d matrix");
test(function() {
var matrix2d = new DOMMatrixReadOnly([2, 0, 0, 2, 10, 10]);
var point = matrix2d.transformPoint(new DOMPoint(5));
assert_dom_point_equals(point, new DOMPoint(20, 10, 0, 1));
}, "DOMMatrixReadOnly transformPoint(DOMPoint(x)) - 2d matrix");
test(function() {
var matrix2d = new DOMMatrixReadOnly([2, 0, 0, 2, 10, 10]);
var point = matrix2d.transformPoint(new DOMPoint(5, 0, 0, 0));
assert_dom_point_equals(point, new DOMPoint(10, 0, 0, 0));
}, "DOMMatrixReadOnly transformPoint(DOMPoint(x, 0, 0, 0)) - 2d matrix");
test(function() {
var matrix2d = new DOMMatrixReadOnly([2, 0, 0, 2, 10, 10]);
var point = matrix2d.transformPoint(new DOMPoint(5, 4));
assert_dom_point_equals(point, new DOMPoint(20, 18, 0, 1));
}, "DOMMatrixReadOnly transformPoint(DOMPoint(x, y)) - 2d matrix");
test(function() {
var matrix2d = new DOMMatrixReadOnly([2, 0, 0, 2, 10, 10]);
var point = matrix2d.transformPoint(new DOMPoint(5, 4, 0, 0));
assert_dom_point_equals(point, new DOMPoint(10, 8, 0, 0));
}, "DOMMatrixReadOnly transformPoint(DOMPoint(x, y, 0, 0)) - 2d matrix");
test(function() {
var matrix2d = new DOMMatrixReadOnly([2, 0, 0, 2, 10, 10]);
var point = matrix2d.transformPoint(new DOMPoint(5, 4, 3));
assert_dom_point_equals(point, new DOMPoint(20, 18, 3, 1));
}, "DOMMatrixReadOnly transformPoint(DOMPoint(x, y, z)) - 2d matrix");
test(function() {
var matrix2d = new DOMMatrixReadOnly([2, 0, 0, 2, 10, 10]);
var point = matrix2d.transformPoint(new DOMPoint(5, 4, 3, 0));
assert_dom_point_equals(point, new DOMPoint(10, 8, 3, 0));
}, "DOMMatrixReadOnly transformPoint(DOMPoint(x, y, z, 0)) - 2d matrix");
test(function() {
var matrix2d = new DOMMatrixReadOnly([2, 0, 0, 2, 10, 10]);
var point = matrix2d.transformPoint(new DOMPoint(5, 4, 14, 5));
assert_dom_point_equals(point, new DOMPoint(60, 58, 14, 5));
}, "DOMMatrixReadOnly transformPoint(DOMPoint(x, y, z, w)) - 2d matrix");
test(function() {
var matrix3d = new DOMMatrixReadOnly([1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16]);
var point = matrix3d.transformPoint(new DOMPoint(5));
assert_dom_point_equals(point, new DOMPoint(18, 24, 30, 36));
}, "DOMMatrixReadOnly transformPoint(DOMPoint(x)) - 3d matrix");
test(function() {
var matrix3d = new DOMMatrixReadOnly([1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16]);
var point = matrix3d.transformPoint(new DOMPoint(5, 0, 0, 0));
assert_dom_point_equals(point, new DOMPoint(5, 10, 15, 20));
}, "DOMMatrixReadOnly transformPoint(DOMPoint(x, 0, 0, 0)) - 3d matrix");
test(function() {
var matrix3d = new DOMMatrixReadOnly([1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16]);
var point = matrix3d.transformPoint(new DOMPoint(5, 4));
assert_dom_point_equals(point, new DOMPoint(38, 48, 58, 68));
}, "DOMMatrixReadOnly transformPoint(DOMPoint(x, y)) - 3d matrix");
test(function() {
var matrix3d = new DOMMatrixReadOnly([1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16]);
var point = matrix3d.transformPoint(new DOMPoint(5, 4, 0, 0));
assert_dom_point_equals(point, new DOMPoint(25, 34, 43, 52));
}, "DOMMatrixReadOnly transformPoint(DOMPoint(x, y, 0, 0)) - 3d matrix");
test(function() {
var matrix3d = new DOMMatrixReadOnly([1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16]);
var point = matrix3d.transformPoint(new DOMPoint(5, 4, 3));
assert_dom_point_equals(point, new DOMPoint(65, 78, 91, 104));
}, "DOMMatrixReadOnly transformPoint(DOMPoint(x, y, z)) - 3d matrix");
test(function() {
var matrix3d = new DOMMatrixReadOnly([1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16]);
var point = matrix3d.transformPoint(new DOMPoint(5, 4, 3, 0));
assert_dom_point_equals(point, new DOMPoint(52, 64, 76, 88));
}, "DOMMatrixReadOnly transformPoint(DOMPoint(x, y, z, 0)) - 3d matrix");
test(function() {
var matrix3d = new DOMMatrixReadOnly([1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16]);
var point = matrix3d.transformPoint(new DOMPoint(5, 4, 14, 5));
assert_dom_point_equals(point, new DOMPoint(216, 244, 272, 300));
}, "DOMMatrixReadOnly transformPoint(DOMPoint(x, y, z, w)) - 3d matrix");
</script>