OLD | NEW |
---|---|
1 <!doctype html> | 1 <!doctype html> |
2 <meta charset="utf-8"> | 2 <meta charset="utf-8"> |
3 <title>Geometry Interfaces: DOMPointReadOnly</title> | 3 <title>Geometry Interfaces: DOMPointReadOnly</title> |
4 <link rel="help" href="https://drafts.fxtf.org/geometry/#DOMPoint"> | 4 <link rel="help" href="https://drafts.fxtf.org/geometry/#DOMPoint"> |
5 <script src="../../resources/testharness.js"></script> | 5 <script src="../../resources/testharness.js"></script> |
6 <script src="../../resources/testharnessreport.js"></script> | 6 <script src="../../resources/testharnessreport.js"></script> |
7 <script src="./resources/geometry-interfaces-test-helpers.js"></script> | 7 <script src="./resources/geometry-interfaces-test-helpers.js"></script> |
8 <script> | 8 <script> |
9 'use strict'; | 9 'use strict'; |
10 | 10 |
(...skipping 22 matching lines...) Expand all Loading... | |
33 | 33 |
34 test(() => { | 34 test(() => { |
35 var point = DOMPointReadOnly.fromPoint(); | 35 var point = DOMPointReadOnly.fromPoint(); |
36 assert_dom_point_equals(point, [0, 0, 0, 1]); | 36 assert_dom_point_equals(point, [0, 0, 0, 1]); |
37 }, 'DOMPointReadOnly.fromPoint() should create a DOMPointReadOnly'); | 37 }, 'DOMPointReadOnly.fromPoint() should create a DOMPointReadOnly'); |
38 | 38 |
39 test(() => { | 39 test(() => { |
40 var point1 = DOMPointReadOnly.fromPoint(); | 40 var point1 = DOMPointReadOnly.fromPoint(); |
41 var point2 = DOMPointReadOnly.fromPoint(); | 41 var point2 = DOMPointReadOnly.fromPoint(); |
42 assert_false(point1 == point2); | 42 assert_false(point1 == point2); |
43 assert_true(point1.x == point2.x); | 43 assert_point_equals(point1, point2); |
44 assert_true(point1.y == point2.y); | |
45 assert_true(point1.z == point2.z); | |
46 assert_true(point1.w == point2.w); | |
47 }, 'DOMPointReadOnly.fromPoint() should create a new DOMPointReadOnly'); | 44 }, 'DOMPointReadOnly.fromPoint() should create a new DOMPointReadOnly'); |
48 | 45 |
46 test(() => { | |
47 var point1 = new DOMPointReadOnly(5, 4, 0, 1); | |
zino
2016/12/28 16:39:14
var point = new DOMPointReadOnly(5, 4);
Byoungkwon Ko
2017/01/03 15:54:37
Done.
| |
48 var point2 = point1.matrixTransform(new DOMMatrixReadOnly([2, 0, 0, 2, 10, 10] )); | |
zino
2016/12/28 16:39:14
nit: Better name is transformed_point.
Byoungkwon Ko
2017/01/03 15:54:37
Done.
| |
49 assert_point_equals(point2, new DOMPoint(20, 18)); | |
zino
2016/12/28 16:39:14
You used |assert_dom_point_equals| in previous CL.
Byoungkwon Ko
2017/01/03 15:54:37
Done.
| |
50 }, 'DOMMatrixReadOnly.matrixTransform() - 2d matrixTransform'); | |
51 | |
52 test(() => { | |
53 var point1 = new DOMPointReadOnly(5, 4, 0, 1); | |
54 var point2 = point1.matrixTransform(new DOMMatrixReadOnly([1, 2, 3, 4, 5, 6, 7 , 8, 9, 10, 11, 12, 13, 14, 15, 16])); | |
55 assert_point_equals(point2, new DOMPoint(38, 48, 58, 68)); | |
56 }, 'DOMMatrixReadOnly.matrixTransform() - 3d matrixTransform'); | |
57 | |
49 </script> | 58 </script> |
OLD | NEW |