4 <title>Geometry Interfaces: DOMPoint
</title>
5 <script src=
"../../resources/js-test.js"></script>
10 debug("# DOMPoint(2, 3)");
11 var point
= new DOMPoint(2, 3);
12 shouldBe("point.x", "2");
13 shouldBe("point.y", "3");
14 shouldBe("point.z", "0");
15 shouldBe("point.w", "1");
18 debug("# DOMPoint(5, 7, 9)");
19 point
= new DOMPoint(5, 7, 9);
20 shouldBe("point.x", "5");
21 shouldBe("point.y", "7");
22 shouldBe("point.z", "9");
23 shouldBe("point.w", "1");
26 debug("# DOMPoint(8, 2, 1, 6)");
27 point
= new DOMPoint(5, 7, 9);
28 point
= new DOMPoint(8, 2, 1, 6);
29 shouldBe("point.x", "8");
30 shouldBe("point.y", "2");
31 shouldBe("point.z", "1");
32 shouldBe("point.w", "6");
35 debug("# DOMPoint({ x : 2 })");
36 point
= new DOMPoint({ x
: 2 });
37 shouldBe("point.x", "2");
38 shouldBe("point.y", "0");
39 shouldBe("point.z", "0");
40 shouldBe("point.w", "1");
43 debug("# DOMPoint({ y : 2 })");
44 point
= new DOMPoint({ y
: 2 });
45 shouldBe("point.x", "0");
46 shouldBe("point.y", "2");
47 shouldBe("point.z", "0");
48 shouldBe("point.w", "1");
51 debug("# DOMPoint({ z : 2 })");
52 point
= new DOMPoint({ z
: 2 });
53 shouldBe("point.x", "0");
54 shouldBe("point.y", "0");
55 shouldBe("point.z", "2");
56 shouldBe("point.w", "1");
59 debug("# DOMPoint({ w : 2 })");
60 point
= new DOMPoint({ w
: 2 });
61 shouldBe("point.x", "0");
62 shouldBe("point.y", "0");
63 shouldBe("point.z", "0");
64 shouldBe("point.w", "2");
67 debug("# DOMPoint({ x : 2, y : 3, z : 4, w : 5 })");
68 point
= new DOMPoint({ x
: 2, y
: 3, z
: 4, w
: 5 });
69 shouldBe("point.x", "2");
70 shouldBe("point.y", "3");
71 shouldBe("point.z", "4");
72 shouldBe("point.w", "5");
75 debug("# DOMPoint()");
76 point
= new DOMPoint();
77 shouldBe("point.x", "0");
78 shouldBe("point.y", "0");
79 shouldBe("point.z", "0");
80 shouldBe("point.w", "1");
83 debug("# DOMPoint setter");
85 shouldBe("point.x", "10");
87 shouldBe("point.y", "20");
89 shouldBe("point.z", "30");
91 shouldBe("point.w", "40");
94 debug("# DOMPointReadOnly(10, 20, 30, 40)");
95 point
= new DOMPointReadOnly(10, 20, 30, 40);
96 shouldBe("point.x", "10");
97 shouldBe("point.y", "20");
98 shouldBe("point.z", "30");
99 shouldBe("point.w", "40");
102 debug("# DOMPointReadOnly readonly test");
104 shouldBe("point.x", "10");
106 shouldBe("point.y", "20");
108 shouldBe("point.z", "30");
110 shouldBe("point.w", "40");