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