| OLD | NEW |
| (Empty) |
| 1 description("This test checks the SVGAnimatedLength API - utilizing the width pr
operty of SVGRectElement"); | |
| 2 | |
| 3 var rectElement = document.createElementNS("http://www.w3.org/2000/svg", "rect")
; | |
| 4 | |
| 5 debug(""); | |
| 6 debug("Check initial width value"); | |
| 7 shouldBeEqualToString("rectElement.width.toString()", "[object SVGAnimatedLength
]"); | |
| 8 shouldBeEqualToString("rectElement.width.baseVal.toString()", "[object SVGLength
]"); | |
| 9 shouldBe("rectElement.width.baseVal.value", "0"); | |
| 10 | |
| 11 debug(""); | |
| 12 debug("Check that lengths are dynamic, caching value in a local variable and mod
ifying it, should take effect"); | |
| 13 var numRef = rectElement.width.baseVal; | |
| 14 numRef.value = 100; | |
| 15 shouldBe("numRef.value", "100"); | |
| 16 shouldBe("rectElement.width.baseVal.value", "100"); | |
| 17 | |
| 18 debug(""); | |
| 19 debug("Check that assigning to baseVal has no effect, as no setter is defined"); | |
| 20 shouldBe("rectElement.width.baseVal = -1", "-1"); | |
| 21 shouldBeEqualToString("rectElement.width.baseVal = 'aString'", "aString"); | |
| 22 shouldBe("rectElement.width.baseVal = rectElement", "rectElement"); | |
| 23 | |
| 24 debug(""); | |
| 25 debug("Check that the width value remained 100, and the baseVal type has not bee
n changed"); | |
| 26 shouldBeEqualToString("rectElement.width.baseVal.toString()", "[object SVGLength
]"); | |
| 27 shouldBe("rectElement.width.baseVal.value", "100"); | |
| 28 | |
| 29 successfullyParsed = true; | |
| OLD | NEW |