| OLD | NEW |
| 1 var svgNS = "http://www.w3.org/2000/svg"; | 1 var svgNS = "http://www.w3.org/2000/svg"; |
| 2 | 2 |
| 3 var svgRoot = document.createElementNS(svgNS, "svg"); | 3 var svgRoot = document.createElementNS(svgNS, "svg"); |
| 4 document.documentElement.appendChild(svgRoot); | 4 document.documentElement.appendChild(svgRoot); |
| 5 | 5 |
| 6 var svgText = document.createElementNS(svgNS, "text"); | 6 var svgText = document.createElementNS(svgNS, "text"); |
| 7 svgText.style.fontFamily = "Ahem"; | 7 svgText.style.fontFamily = "Ahem"; |
| 8 svgText.style.fontSize = "20px"; | 8 svgText.style.fontSize = "20px"; |
| 9 svgText.appendChild(document.createTextNode("abc")); | 9 svgText.appendChild(document.createTextNode("abc")); |
| 10 svgRoot.appendChild(svgText); | 10 svgRoot.appendChild(svgText); |
| 11 | 11 |
| 12 shouldThrow("svgText.selectSubString(-1, 0)"); | 12 shouldThrow("svgText.selectSubString(-1, 0)", "'IndexSizeError: Index or size wa
s negative, or greater than the allowed value.'"); |
| 13 shouldThrow("svgText.getSubStringLength(0, -1)"); | 13 shouldNotThrow("svgText.getSubStringLength(0, -1)"); |
| 14 shouldThrow("svgText.getSubStringLength(3, 0)"); | 14 shouldThrow("svgText.getSubStringLength(3, 0)", "'IndexSizeError: Index or size
was negative, or greater than the allowed value.'"); |
| 15 | 15 |
| 16 // cleanup | 16 // cleanup |
| 17 document.documentElement.removeChild(svgRoot); | 17 document.documentElement.removeChild(svgRoot); |
| 18 | 18 |
| 19 var successfullyParsed = true; | 19 var successfullyParsed = true; |
| OLD | NEW |