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

Side by Side Diff: third_party/WebKit/LayoutTests/fast/dom/geometry-interfaces-dom-matrix-transformPoint.html

Issue 2423753002: [GeometryInterface] add transformPoint(point) function. (Closed)
Patch Set: update test msg. Created 4 years, 1 month 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
« no previous file with comments | « no previous file | third_party/WebKit/LayoutTests/fast/dom/resources/geometry-interfaces-test-helpers.js » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 <!DOCTYPE HTML>
2 <script src="../../resources/testharness.js"></script>
3 <script src="../../resources/testharnessreport.js"></script>
4 <script src="./resources/geometry-interfaces-test-helpers.js"></script>
5 <script>
6
7 test(function() {
8 var matrix2d = new DOMMatrixReadOnly([1, 2, 3, 4, 5, 6]);
9 var point = matrix2d.transformPoint();
10 assert_point_equals(point, new DOMPoint(5, 6, 0, 1));
11 }, "DOMMatrixReadOnly transformPoint() - 2d matrix ");
12
13 test(function() {
14 var matrix3d = new DOMMatrixReadOnly([1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 1 3, 14, 15, 16]);
15 var point = matrix3d.transformPoint();
16 assert_point_equals(point, new DOMPoint(13, 14, 15, 16));
17 }, "DOMMatrixReadOnly transformPoint() - 3d matrix");
18
19 test(function() {
20 var matrix2d = new DOMMatrixReadOnly([2, 0, 0, 2, 10, 10]);
21 var point = matrix2d.transformPoint(new DOMPoint(5));
22 assert_point_equals(point, new DOMPoint(20, 10, 0, 1));
23 }, "DOMMatrixReadOnly transformPoint(DOMPoint(x)) - 2d matrix");
24
25 test(function() {
26 var matrix2d = new DOMMatrixReadOnly([2, 0, 0, 2, 10, 10]);
27 var point = matrix2d.transformPoint(new DOMPoint(5, 0, 0, 0));
28 assert_point_equals(point, new DOMPoint(10, 0, 0, 0));
29 }, "DOMMatrixReadOnly transformPoint(DOMPoint(x, 0, 0, 0)) - 2d matrix");
30
31 test(function() {
32 var matrix2d = new DOMMatrixReadOnly([2, 0, 0, 2, 10, 10]);
33 var point = matrix2d.transformPoint(new DOMPoint(5, 4));
34 assert_point_equals(point, new DOMPoint(20, 18, 0, 1));
35 }, "DOMMatrixReadOnly transformPoint(DOMPoint(x, y)) - 2d matrix");
36
37 test(function() {
38 var matrix2d = new DOMMatrixReadOnly([2, 0, 0, 2, 10, 10]);
39 var point = matrix2d.transformPoint(new DOMPoint(5, 4, 0, 0));
40 assert_point_equals(point, new DOMPoint(10, 8, 0, 0));
41 }, "DOMMatrixReadOnly transformPoint(DOMPoint(x, y, 0, 0)) - 2d matrix");
42
43 test(function() {
44 var matrix2d = new DOMMatrixReadOnly([2, 0, 0, 2, 10, 10]);
45 var point = matrix2d.transformPoint(new DOMPoint(5, 4, 3));
46 assert_point_equals(point, new DOMPoint(20, 18, 3, 1));
47 }, "DOMMatrixReadOnly transformPoint(DOMPoint(x, y, z)) - 2d matrix");
48
49 test(function() {
50 var matrix2d = new DOMMatrixReadOnly([2, 0, 0, 2, 10, 10]);
51 var point = matrix2d.transformPoint(new DOMPoint(5, 4, 3, 0));
52 assert_point_equals(point, new DOMPoint(10, 8, 3, 0));
53 }, "DOMMatrixReadOnly transformPoint(DOMPoint(x, y, z, 0)) - 2d matrix");
54
55 test(function() {
56 var matrix2d = new DOMMatrixReadOnly([2, 0, 0, 2, 10, 10]);
57 var point = matrix2d.transformPoint(new DOMPoint(5, 4, 14, 5));
58 assert_point_equals(point, new DOMPoint(60, 58, 14, 5));
59 }, "DOMMatrixReadOnly transformPoint(DOMPoint(x, y, z, w)) - 2d matrix");
60
61 test(function() {
62 var matrix3d = new DOMMatrixReadOnly([1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 1 3, 14, 15, 16]);
63 var point = matrix3d.transformPoint(new DOMPoint(5));
64 assert_point_equals(point, new DOMPoint(18, 24, 30, 36));
65 }, "DOMMatrixReadOnly transformPoint(DOMPoint(x)) - 3d matrix");
66
67 test(function() {
68 var matrix3d = new DOMMatrixReadOnly([1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 1 3, 14, 15, 16]);
69 var point = matrix3d.transformPoint(new DOMPoint(5, 0, 0, 0));
70 assert_point_equals(point, new DOMPoint(5, 10, 15, 20));
71 }, "DOMMatrixReadOnly transformPoint(DOMPoint(x, 0, 0, 0)) - 3d matrix");
72
73 test(function() {
74 var matrix3d = new DOMMatrixReadOnly([1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 1 3, 14, 15, 16]);
75 var point = matrix3d.transformPoint(new DOMPoint(5, 4));
76 assert_point_equals(point, new DOMPoint(38, 48, 58, 68));
77 }, "DOMMatrixReadOnly transformPoint(DOMPoint(x, y)) - 3d matrix");
78
79 test(function() {
80 var matrix3d = new DOMMatrixReadOnly([1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 1 3, 14, 15, 16]);
81 var point = matrix3d.transformPoint(new DOMPoint(5, 4, 0, 0));
82 assert_point_equals(point, new DOMPoint(25, 34, 43, 52));
83 }, "DOMMatrixReadOnly transformPoint(DOMPoint(x, y, 0, 0)) - 3d matrix");
84
85 test(function() {
86 var matrix3d = new DOMMatrixReadOnly([1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 1 3, 14, 15, 16]);
87 var point = matrix3d.transformPoint(new DOMPoint(5, 4, 3));
88 assert_point_equals(point, new DOMPoint(65, 78, 91, 104));
89 }, "DOMMatrixReadOnly transformPoint(DOMPoint(x, y, z)) - 3d matrix");
90
91 test(function() {
92 var matrix3d = new DOMMatrixReadOnly([1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 1 3, 14, 15, 16]);
93 var point = matrix3d.transformPoint(new DOMPoint(5, 4, 3, 0));
94 assert_point_equals(point, new DOMPoint(52, 64, 76, 88));
95 }, "DOMMatrixReadOnly transformPoint(DOMPoint(x, y, z, 0)) - 3d matrix");
96
97 test(function() {
98 var matrix3d = new DOMMatrixReadOnly([1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 1 3, 14, 15, 16]);
99 var point = matrix3d.transformPoint(new DOMPoint(5, 4, 14, 5));
100 assert_point_equals(point, new DOMPoint(216, 244, 272, 300));
101 }, "DOMMatrixReadOnly transformPoint(DOMPoint(x, y, z, w)) - 3d matrix");
102 </script>
OLDNEW
« no previous file with comments | « no previous file | third_party/WebKit/LayoutTests/fast/dom/resources/geometry-interfaces-test-helpers.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698