OLD | NEW |
| (Empty) |
1 description("This test checks the SVGAnimatedPreserveAspectRatio API - utilizing
the preserveAspectRatio property of SVGSVGElement"); | |
2 | |
3 var svgElement = document.createElementNS("http://www.w3.org/2000/svg", "svg"); | |
4 | |
5 debug(""); | |
6 debug("Check initial preserveAspectRatio value"); | |
7 shouldBeEqualToString("svgElement.preserveAspectRatio.toString()", "[object SVGA
nimatedPreserveAspectRatio]"); | |
8 shouldBeEqualToString("svgElement.preserveAspectRatio.baseVal.toString()", "[obj
ect SVGPreserveAspectRatio]"); | |
9 shouldBe("svgElement.preserveAspectRatio.baseVal.align", "SVGPreserveAspectRatio
.SVG_PRESERVEASPECTRATIO_XMIDYMID"); | |
10 shouldBe("svgElement.preserveAspectRatio.baseVal.meetOrSlice", "SVGPreserveAspec
tRatio.SVG_MEETORSLICE_MEET"); | |
11 | |
12 debug(""); | |
13 debug("Check that preserveAspectRatios are dynamic, caching value in a local var
iable and modifying it, should take effect"); | |
14 var aspectRef = svgElement.preserveAspectRatio.baseVal; | |
15 aspectRef.align = SVGPreserveAspectRatio.SVG_PRESERVEASPECTRATIO_XMAXYMIN; | |
16 aspectRef.meetOrSlice = SVGPreserveAspectRatio.SVG_MEETORSLICE_SLICE; | |
17 shouldBe("aspectRef.align", "SVGPreserveAspectRatio.SVG_PRESERVEASPECTRATIO_XMAX
YMIN"); | |
18 shouldBe("aspectRef.meetOrSlice", "SVGPreserveAspectRatio.SVG_MEETORSLICE_SLICE"
); | |
19 shouldBe("svgElement.preserveAspectRatio.baseVal.align", "SVGPreserveAspectRatio
.SVG_PRESERVEASPECTRATIO_XMAXYMIN"); | |
20 shouldBe("svgElement.preserveAspectRatio.baseVal.meetOrSlice", "SVGPreserveAspec
tRatio.SVG_MEETORSLICE_SLICE"); | |
21 | |
22 debug(""); | |
23 debug("Check that assigning to baseVal has no effect, as no setter is defined"); | |
24 shouldBe("svgElement.preserveAspectRatio.baseVal = -1", "-1"); | |
25 shouldBeEqualToString("svgElement.preserveAspectRatio.baseVal = 'aString'", "aSt
ring"); | |
26 shouldBe("svgElement.preserveAspectRatio.baseVal = svgElement", "svgElement"); | |
27 | |
28 debug(""); | |
29 debug("Check that the preserveAspectRatio align/meetOrSlice remained xMaxYMin/sl
ice, and the baseVal type has not been changed"); | |
30 shouldBeEqualToString("svgElement.preserveAspectRatio.baseVal.toString()", "[obj
ect SVGPreserveAspectRatio]"); | |
31 shouldBe("svgElement.preserveAspectRatio.baseVal.align", "SVGPreserveAspectRatio
.SVG_PRESERVEASPECTRATIO_XMAXYMIN"); | |
32 shouldBe("svgElement.preserveAspectRatio.baseVal.meetOrSlice", "SVGPreserveAspec
tRatio.SVG_MEETORSLICE_SLICE"); | |
33 | |
34 successfullyParsed = true; | |
OLD | NEW |