OLD | NEW |
| (Empty) |
1 This test checks SVGLength - converting from px to all other unit types | |
2 | |
3 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE
". | |
4 | |
5 | |
6 | |
7 Set value to be 2px | |
8 PASS length.unitType is SVGLength.SVG_LENGTHTYPE_PX | |
9 PASS length.value is 2 | |
10 PASS length.valueInSpecifiedUnits is 2 | |
11 PASS length.valueAsString is "2px" | |
12 | |
13 Convert from px to unitless | |
14 PASS length.convertToSpecifiedUnits(SVGLength.SVG_LENGTHTYPE_NUMBER) is undefine
d. | |
15 PASS length.valueAsString is "2" | |
16 PASS length.value is 2 | |
17 PASS length.valueInSpecifiedUnits is 2 | |
18 PASS length.unitType is SVGLength.SVG_LENGTHTYPE_NUMBER | |
19 | |
20 Reset to 2px | |
21 | |
22 Convert from px to percentage | |
23 PASS length.convertToSpecifiedUnits(SVGLength.SVG_LENGTHTYPE_PERCENTAGE) is unde
fined. | |
24 PASS length.valueAsString is "1.33333%" | |
25 PASS length.valueInSpecifiedUnits.toFixed(5) is "1.33333" | |
26 PASS length.value.toFixed(1) is "2.0" | |
27 PASS length.unitType is SVGLength.SVG_LENGTHTYPE_PERCENTAGE | |
28 | |
29 Reset to 2px | |
30 | |
31 Convert from px to ems | |
32 PASS length.convertToSpecifiedUnits(SVGLength.SVG_LENGTHTYPE_EMS) is undefined. | |
33 PASS length.valueAsString is "0.166667em" | |
34 PASS length.valueInSpecifiedUnits.toFixed(6) is "0.166667" | |
35 PASS length.value.toFixed(1) is "2.0" | |
36 PASS length.unitType is SVGLength.SVG_LENGTHTYPE_EMS | |
37 | |
38 Reset to 2px | |
39 | |
40 Convert from px to exs | |
41 PASS length.convertToSpecifiedUnits(SVGLength.SVG_LENGTHTYPE_EXS) is undefined. | |
42 PASS length.valueInSpecifiedUnits.toFixed(1) is "0.2" | |
43 PASS length.value.toFixed(1) is "2.0" | |
44 PASS length.unitType is SVGLength.SVG_LENGTHTYPE_EXS | |
45 | |
46 Reset to 2px | |
47 | |
48 Convert from px to cm | |
49 PASS length.convertToSpecifiedUnits(SVGLength.SVG_LENGTHTYPE_CM) is undefined. | |
50 PASS length.valueAsString is "0.0529167cm" | |
51 PASS length.valueInSpecifiedUnits.toFixed(7) is "0.0529167" | |
52 PASS length.value.toFixed(1) is "2.0" | |
53 PASS length.unitType is SVGLength.SVG_LENGTHTYPE_CM | |
54 | |
55 Reset to 2px | |
56 | |
57 Convert from px to mm | |
58 PASS length.convertToSpecifiedUnits(SVGLength.SVG_LENGTHTYPE_MM) is undefined. | |
59 PASS length.valueAsString is "0.529167mm" | |
60 PASS length.valueInSpecifiedUnits.toFixed(6) is "0.529167" | |
61 PASS length.value.toFixed(1) is "2.0" | |
62 PASS length.unitType is SVGLength.SVG_LENGTHTYPE_MM | |
63 | |
64 Reset to 2px | |
65 | |
66 Convert from px to in | |
67 PASS length.convertToSpecifiedUnits(SVGLength.SVG_LENGTHTYPE_IN) is undefined. | |
68 PASS length.valueAsString is "0.0208333in" | |
69 PASS length.valueInSpecifiedUnits.toFixed(7) is "0.0208333" | |
70 PASS length.value.toFixed(1) is "2.0" | |
71 PASS length.unitType is SVGLength.SVG_LENGTHTYPE_IN | |
72 | |
73 Reset to 2px | |
74 | |
75 Convert from px to pt | |
76 PASS length.convertToSpecifiedUnits(SVGLength.SVG_LENGTHTYPE_PT) is undefined. | |
77 PASS length.valueAsString is "1.5pt" | |
78 PASS length.valueInSpecifiedUnits is 1.5 | |
79 PASS length.value.toFixed(1) is "2.0" | |
80 PASS length.unitType is SVGLength.SVG_LENGTHTYPE_PT | |
81 | |
82 Reset to 2px | |
83 | |
84 Convert from px to pc | |
85 PASS length.convertToSpecifiedUnits(SVGLength.SVG_LENGTHTYPE_PC) is undefined. | |
86 PASS length.valueInSpecifiedUnits.toFixed(3) is "0.125" | |
87 PASS length.value.toFixed(1) is "2.0" | |
88 PASS length.unitType is SVGLength.SVG_LENGTHTYPE_PC | |
89 PASS successfullyParsed is true | |
90 | |
91 TEST COMPLETE | |
92 | |
OLD | NEW |