| OLD | NEW |
| (Empty) |
| 1 description("This test checks the use of SVGAnimatedEnumeration within SVGTextCo
ntentElement"); | |
| 2 | |
| 3 var textContentElement = document.createElementNS("http://www.w3.org/2000/svg",
"text"); | |
| 4 textContentElement.setAttribute("lengthAdjust", "spacing"); | |
| 5 | |
| 6 debug(""); | |
| 7 debug("Check initial 'lengthAdjust' value"); | |
| 8 shouldBeEqualToString("textContentElement.lengthAdjust.toString()", "[object SVG
AnimatedEnumeration]"); | |
| 9 shouldBeEqualToString("typeof(textContentElement.lengthAdjust.baseVal)", "number
"); | |
| 10 shouldBe("textContentElement.lengthAdjust.baseVal", "SVGTextContentElement.LENGT
HADJUST_SPACING"); | |
| 11 | |
| 12 debug(""); | |
| 13 debug("Switch to 'spacingAndGlyphs'"); | |
| 14 shouldBe("textContentElement.lengthAdjust.baseVal = SVGTextContentElement.LENGTH
ADJUST_SPACINGANDGLYPHS", "SVGTextContentElement.LENGTHADJUST_SPACINGANDGLYPHS")
; | |
| 15 shouldBe("textContentElement.lengthAdjust.baseVal", "SVGTextContentElement.LENGT
HADJUST_SPACINGANDGLYPHS"); | |
| 16 shouldBeEqualToString("textContentElement.getAttribute('lengthAdjust')", "spacin
gAndGlyphs"); | |
| 17 | |
| 18 debug(""); | |
| 19 debug("Try setting invalid values"); | |
| 20 shouldThrow("textContentElement.lengthAdjust.baseVal = 3"); | |
| 21 shouldBe("textContentElement.lengthAdjust.baseVal", "SVGTextContentElement.LENGT
HADJUST_SPACINGANDGLYPHS"); | |
| 22 shouldBeEqualToString("textContentElement.getAttribute('lengthAdjust')", "spacin
gAndGlyphs"); | |
| 23 | |
| 24 shouldThrow("textContentElement.lengthAdjust.baseVal = -1"); | |
| 25 shouldBe("textContentElement.lengthAdjust.baseVal", "SVGTextContentElement.LENGT
HADJUST_SPACINGANDGLYPHS"); | |
| 26 shouldBeEqualToString("textContentElement.getAttribute('lengthAdjust')", "spacin
gAndGlyphs"); | |
| 27 | |
| 28 shouldThrow("textContentElement.lengthAdjust.baseVal = 0"); | |
| 29 shouldBe("textContentElement.lengthAdjust.baseVal", "SVGTextContentElement.LENGT
HADJUST_SPACINGANDGLYPHS"); | |
| 30 shouldBeEqualToString("textContentElement.getAttribute('lengthAdjust')", "spacin
gAndGlyphs"); | |
| 31 | |
| 32 debug(""); | |
| 33 debug("Switch to 'spacing'"); | |
| 34 shouldBe("textContentElement.lengthAdjust.baseVal = SVGTextContentElement.LENGTH
ADJUST_SPACING", "SVGTextContentElement.LENGTHADJUST_SPACING"); | |
| 35 shouldBe("textContentElement.lengthAdjust.baseVal", "SVGTextContentElement.LENGT
HADJUST_SPACING"); | |
| 36 shouldBeEqualToString("textContentElement.getAttribute('lengthAdjust')", "spacin
g"); | |
| 37 | |
| 38 successfullyParsed = true; | |
| OLD | NEW |