OLD | NEW |
| (Empty) |
1 This is a test of the SVGPathSegList::appendItem() API. | |
2 | |
3 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE
". | |
4 | |
5 | |
6 | |
7 Check initial 'pathSegList' value of path1 | |
8 PASS path1.pathSegList.numberOfItems is 3 | |
9 PASS path1.pathSegList.getItem(0).toString() is "[object SVGPathSegMovetoAbs]" | |
10 PASS path1.pathSegList.getItem(0).x is 0 | |
11 PASS path1.pathSegList.getItem(0).y is 0 | |
12 PASS path1.pathSegList.getItem(1).toString() is "[object SVGPathSegLinetoAbs]" | |
13 PASS path1.pathSegList.getItem(1).x is 100 | |
14 PASS path1.pathSegList.getItem(1).y is 0 | |
15 PASS path1.pathSegList.getItem(2).toString() is "[object SVGPathSegLinetoAbs]" | |
16 PASS path1.pathSegList.getItem(2).x is 100 | |
17 PASS path1.pathSegList.getItem(2).y is 100 | |
18 | |
19 Check initial 'pathSegList' value of path2 | |
20 PASS path2.pathSegList.numberOfItems is 5 | |
21 PASS path2.pathSegList.getItem(0).toString() is "[object SVGPathSegMovetoAbs]" | |
22 PASS path2.pathSegList.getItem(0).x is 0 | |
23 PASS path2.pathSegList.getItem(0).y is 0 | |
24 PASS path2.pathSegList.getItem(1).toString() is "[object SVGPathSegLinetoAbs]" | |
25 PASS path2.pathSegList.getItem(1).x is 50 | |
26 PASS path2.pathSegList.getItem(1).y is 100 | |
27 PASS path2.pathSegList.getItem(2).toString() is "[object SVGPathSegLinetoHorizon
talRel]" | |
28 PASS path2.pathSegList.getItem(2).x is 100 | |
29 PASS path2.pathSegList.getItem(3).toString() is "[object SVGPathSegLinetoHorizon
talRel]" | |
30 PASS path2.pathSegList.getItem(3).x is 100 | |
31 PASS path2.pathSegList.getItem(4).toString() is "[object SVGPathSegLinetoVertica
lRel]" | |
32 PASS path2.pathSegList.getItem(4).y is 100 | |
33 | |
34 Negate x value of fourth segment in path2 | |
35 PASS path2.pathSegList.getItem(3).x = -path2.pathSegList.getItem(3).x is -100 | |
36 | |
37 Append second item from path1 to path2 list | |
38 PASS path2.pathSegList.appendItem(path2.pathSegList.getItem(3)).toString() is "[
object SVGPathSegLinetoHorizontalRel]" | |
39 PASS path2.pathSegList.numberOfItems is 6 | |
40 PASS path2.pathSegList.getItem(0).toString() is "[object SVGPathSegMovetoAbs]" | |
41 PASS path2.pathSegList.getItem(0).x is 0 | |
42 PASS path2.pathSegList.getItem(0).y is 0 | |
43 PASS path2.pathSegList.getItem(1).toString() is "[object SVGPathSegLinetoAbs]" | |
44 PASS path2.pathSegList.getItem(1).x is 50 | |
45 PASS path2.pathSegList.getItem(1).y is 100 | |
46 PASS path2.pathSegList.getItem(2).toString() is "[object SVGPathSegLinetoHorizon
talRel]" | |
47 PASS path2.pathSegList.getItem(2).x is 100 | |
48 PASS path2.pathSegList.getItem(3).toString() is "[object SVGPathSegLinetoHorizon
talRel]" | |
49 PASS path2.pathSegList.getItem(3).x is -100 | |
50 PASS path2.pathSegList.getItem(4).toString() is "[object SVGPathSegLinetoVertica
lRel]" | |
51 PASS path2.pathSegList.getItem(4).y is 100 | |
52 PASS path2.pathSegList.getItem(5).toString() is "[object SVGPathSegLinetoHorizon
talRel]" | |
53 PASS path2.pathSegList.getItem(5).x is -100 | |
54 | |
55 Append second item from path2 to path1 list | |
56 PASS path1.pathSegList.appendItem(path2.pathSegList.getItem(1)).toString() is "[
object SVGPathSegLinetoAbs]" | |
57 | |
58 Change last item of path1 list, that came from path2 list, assure it's updating
path1 | |
59 PASS path1.pathSegList.getItem(3).x -= 50 is 0 | |
60 | |
61 Reset points attribute to M 0 0 L 100 0 v 100 | |
62 PASS path2.setAttribute('d', 'M 0 0 L 100 0 v 100') is undefined. | |
63 | |
64 Append fourth item from path1 to path2 list - now should look like a rectangle | |
65 PASS path2.pathSegList.appendItem(path1.pathSegList.getItem(3)).toString() is "[
object SVGPathSegLinetoAbs]" | |
66 | |
67 Check final 'pathSegList' value of path1 | |
68 PASS path1.pathSegList.numberOfItems is 4 | |
69 PASS path1.pathSegList.getItem(0).toString() is "[object SVGPathSegMovetoAbs]" | |
70 PASS path1.pathSegList.getItem(0).x is 0 | |
71 PASS path1.pathSegList.getItem(0).y is 0 | |
72 PASS path1.pathSegList.getItem(1).toString() is "[object SVGPathSegLinetoAbs]" | |
73 PASS path1.pathSegList.getItem(1).x is 100 | |
74 PASS path1.pathSegList.getItem(1).y is 0 | |
75 PASS path1.pathSegList.getItem(2).toString() is "[object SVGPathSegLinetoAbs]" | |
76 PASS path1.pathSegList.getItem(2).x is 100 | |
77 PASS path1.pathSegList.getItem(2).y is 100 | |
78 PASS path1.pathSegList.getItem(3).toString() is "[object SVGPathSegLinetoAbs]" | |
79 PASS path1.pathSegList.getItem(3).x is 0 | |
80 PASS path1.pathSegList.getItem(3).y is 100 | |
81 | |
82 Check final 'pathSegList' value of path2 | |
83 PASS path2.pathSegList.numberOfItems is 4 | |
84 PASS path2.pathSegList.getItem(0).toString() is "[object SVGPathSegMovetoAbs]" | |
85 PASS path2.pathSegList.getItem(0).x is 0 | |
86 PASS path2.pathSegList.getItem(0).y is 0 | |
87 PASS path2.pathSegList.getItem(1).toString() is "[object SVGPathSegLinetoAbs]" | |
88 PASS path2.pathSegList.getItem(1).x is 100 | |
89 PASS path1.pathSegList.getItem(1).y is 0 | |
90 PASS path2.pathSegList.getItem(2).toString() is "[object SVGPathSegLinetoVertica
lRel]" | |
91 PASS path2.pathSegList.getItem(2).y is 100 | |
92 PASS path2.pathSegList.getItem(3).toString() is "[object SVGPathSegLinetoAbs]" | |
93 PASS path2.pathSegList.getItem(3).x is 0 | |
94 PASS path1.pathSegList.getItem(3).y is 100 | |
95 PASS successfullyParsed is true | |
96 | |
97 TEST COMPLETE | |
98 | |
OLD | NEW |