| Complete test of the SVGTextContentElement API |
| |
| On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE". |
| |
| |
| Test SVGTextContentElement SVG DOM properties |
| PASS svgText.textLength.baseVal.value.toFixed(1) is "200.0" |
| PASS svgText.lengthAdjust.baseVal is SVGTextContentElement.LENGTHADJUST_SPACINGANDGLYPHS |
| |
| Test getNumberOfChars() API |
| PASS svgText.getNumberOfChars() is 4 |
| |
| Test getComputedTextLength() API |
| PASS lengthToString(svgText.getComputedTextLength()) is "200.0" |
| |
| Test getSubStringLength() API |
| PASS lengthToString(svgText.getSubStringLength(0, 1)) is "62.8" |
| PASS lengthToString(svgText.getSubStringLength(0, 2)) is "108.6" |
| PASS lengthToString(svgText.getSubStringLength(0, 3)) is "160.0" |
| PASS lengthToString(svgText.getSubStringLength(0, 4)) is "188.6" |
| PASS lengthToString(svgText.getSubStringLength(1, 1)) is "57.2" |
| PASS lengthToString(svgText.getSubStringLength(1, 2)) is "108.6" |
| PASS lengthToString(svgText.getSubStringLength(1, 3)) is "137.2" |
| PASS lengthToString(svgText.getSubStringLength(2, 1)) is "51.4" |
| PASS lengthToString(svgText.getSubStringLength(2, 2)) is "80.0" |
| PASS lengthToString(svgText.getSubStringLength(3, 1)) is "28.6" |
| |
| Test getStartPositionOfChar() API |
| PASS pointToString(svgText.getStartPositionOfChar(0)) is "(10.0,20.0)" |
| PASS pointToString(svgText.getStartPositionOfChar(1)) is "(72.8,20.0)" |
| PASS pointToString(svgText.getStartPositionOfChar(2)) is "(118.6,20.0)" |
| PASS pointToString(svgText.getStartPositionOfChar(3)) is "(170.0,20.0)" |
| |
| Test getEndPositionOfChar() API |
| PASS pointToString(svgText.getEndPositionOfChar(0)) is "(72.8,20.0)" |
| PASS pointToString(svgText.getEndPositionOfChar(1)) is "(118.6,20.0)" |
| PASS pointToString(svgText.getEndPositionOfChar(2)) is "(170.0,20.0)" |
| PASS pointToString(svgText.getEndPositionOfChar(3)) is "(198.6,20.0)" |
| |
| Test getExtentOfChar() API |
| PASS rectToString(svgText.getExtentOfChar(0)) is "(10.0,1.9)-(62.8x22.3)" |
| PASS rectToString(svgText.getExtentOfChar(1)) is "(72.8,1.9)-(57.2x22.3)" |
| PASS rectToString(svgText.getExtentOfChar(2)) is "(118.6,1.9)-(51.4x22.3)" |
| PASS rectToString(svgText.getExtentOfChar(3)) is "(170.0,1.9)-(28.6x22.3)" |
| |
| Test getRotationOfChar() API |
| PASS svgText.getRotationOfChar(0).toFixed(1) is "0.0" |
| PASS svgText.getRotationOfChar(1).toFixed(1) is "0.0" |
| PASS svgText.getRotationOfChar(2).toFixed(1) is "0.0" |
| PASS svgText.getRotationOfChar(3).toFixed(1) is "0.0" |
| |
| Test getCharNumAtPosition() API |
| > Testing point=(0.0,10.0) |
| PASS svgText.getCharNumAtPosition(point) is -1 |
| PASS svgText.getCharNumAtPosition(pointDict) is -1 |
| > Testing point=(9.9,10.0) |
| PASS svgText.getCharNumAtPosition(point) is -1 |
| PASS svgText.getCharNumAtPosition(pointDict) is -1 |
| > Testing point=(10.1,10.0) |
| PASS svgText.getCharNumAtPosition(point) is 0 |
| PASS svgText.getCharNumAtPosition(pointDict) is 0 |
| > Testing point=(71.4,10.0) |
| PASS svgText.getCharNumAtPosition(point) is 0 |
| > Testing point=(71.6,10.0) |
| PASS svgText.getCharNumAtPosition(point) is 0 |
| > Testing point=(127.8,10.0) |
| PASS svgText.getCharNumAtPosition(point) is 1 |
| PASS svgText.getCharNumAtPosition(pointDict) is 1 |
| > Testing point=(128.0,10.0) |
| PASS svgText.getCharNumAtPosition(point) is 1 |
| > Testing point=(179.1,10.0) |
| PASS svgText.getCharNumAtPosition(point) is 3 |
| PASS svgText.getCharNumAtPosition(pointDict) is 3 |
| > Testing point=(179.3,10.0) |
| PASS svgText.getCharNumAtPosition(point) is 3 |
| > Testing point=(209.9,10.0) |
| PASS svgText.getCharNumAtPosition(point) is -1 |
| > Testing point=(210.1,10.0) |
| PASS svgText.getCharNumAtPosition(point) is -1 |
| > Testing point=(250.0,10.0) |
| PASS svgText.getCharNumAtPosition(point) is -1 |
| PASS successfullyParsed is true |
| |
| TEST COMPLETE |
| |