1 Complete test of the SVGTextContentElement API
3 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
6 Test SVGTextContentElement SVG DOM properties
7 PASS svgText.textLength.baseVal.value.toFixed(1) is "200.0"
8 PASS svgText.lengthAdjust.baseVal is SVGTextContentElement.LENGTHADJUST_SPACINGANDGLYPHS
10 Test getNumberOfChars() API
11 PASS svgText.getNumberOfChars() is 4
13 Test getComputedTextLength() API
14 PASS lengthToString(svgText.getComputedTextLength()) is "200.0"
16 Test getSubStringLength() API
17 PASS lengthToString(svgText.getSubStringLength(0, 1)) is "61.5"
18 PASS lengthToString(svgText.getSubStringLength(0, 2)) is "117.9"
19 PASS lengthToString(svgText.getSubStringLength(0, 3)) is "169.2"
20 PASS lengthToString(svgText.getSubStringLength(0, 4)) is "200.0"
21 PASS lengthToString(svgText.getSubStringLength(1, 1)) is "56.4"
22 PASS lengthToString(svgText.getSubStringLength(1, 2)) is "107.7"
23 PASS lengthToString(svgText.getSubStringLength(1, 3)) is "138.5"
24 PASS lengthToString(svgText.getSubStringLength(2, 1)) is "51.3"
25 PASS lengthToString(svgText.getSubStringLength(2, 2)) is "82.1"
26 PASS lengthToString(svgText.getSubStringLength(3, 1)) is "30.8"
28 Test getStartPositionOfChar() API
29 PASS pointToString(svgText.getStartPositionOfChar(0)) is "(10.0,20.0)"
30 PASS pointToString(svgText.getStartPositionOfChar(1)) is "(71.5,20.0)"
31 PASS pointToString(svgText.getStartPositionOfChar(2)) is "(127.9,20.0)"
32 PASS pointToString(svgText.getStartPositionOfChar(3)) is "(179.2,20.0)"
34 Test getEndPositionOfChar() API
35 PASS pointToString(svgText.getEndPositionOfChar(0)) is "(71.5,20.0)"
36 PASS pointToString(svgText.getEndPositionOfChar(1)) is "(127.9,20.0)"
37 PASS pointToString(svgText.getEndPositionOfChar(2)) is "(179.2,20.0)"
38 PASS pointToString(svgText.getEndPositionOfChar(3)) is "(210.0,20.0)"
40 Test getExtentOfChar() API
41 FAIL rectToString(svgText.getExtentOfChar(0)) should be (10.0,1.9)-(61.5x22.3). Was (10.0,1.0)-(61.5x23.0).
42 FAIL rectToString(svgText.getExtentOfChar(1)) should be (71.5,1.9)-(56.4x22.3). Was (71.5,1.0)-(56.4x23.0).
43 FAIL rectToString(svgText.getExtentOfChar(2)) should be (127.9,1.9)-(51.3x22.3). Was (127.9,1.0)-(51.3x23.0).
44 FAIL rectToString(svgText.getExtentOfChar(3)) should be (179.2,1.9)-(30.8x22.3). Was (179.2,1.0)-(30.8x23.0).
46 Test getRotationOfChar() API
47 PASS svgText.getRotationOfChar(0).toFixed(1) is "0.0"
48 PASS svgText.getRotationOfChar(1).toFixed(1) is "0.0"
49 PASS svgText.getRotationOfChar(2).toFixed(1) is "0.0"
50 PASS svgText.getRotationOfChar(3).toFixed(1) is "0.0"
52 Test getCharNumAtPosition() API
53 > Testing point=(0.0,10.0)
54 PASS svgText.getCharNumAtPosition(point) is -1
55 > Testing point=(9.9,10.0)
56 PASS svgText.getCharNumAtPosition(point) is -1
57 > Testing point=(10.1,10.0)
58 PASS svgText.getCharNumAtPosition(point) is 0
59 > Testing point=(71.4,10.0)
60 PASS svgText.getCharNumAtPosition(point) is 0
61 > Testing point=(71.6,10.0)
62 PASS svgText.getCharNumAtPosition(point) is 1
63 > Testing point=(127.8,10.0)
64 PASS svgText.getCharNumAtPosition(point) is 1
65 > Testing point=(128.0,10.0)
66 PASS svgText.getCharNumAtPosition(point) is 2
67 > Testing point=(179.1,10.0)
68 PASS svgText.getCharNumAtPosition(point) is 2
69 > Testing point=(179.3,10.0)
70 PASS svgText.getCharNumAtPosition(point) is 3
71 > Testing point=(209.9,10.0)
72 PASS svgText.getCharNumAtPosition(point) is 3
73 > Testing point=(210.1,10.0)
74 PASS svgText.getCharNumAtPosition(point) is -1
75 > Testing point=(250.0,10.0)
76 PASS svgText.getCharNumAtPosition(point) is -1
77 PASS successfullyParsed is true