OLD | NEW |
| (Empty) |
1 description("This test checks the use of SVGAnimatedEnumeration within SVGClipPa
thElement"); | |
2 | |
3 var clipPathElement = document.createElementNS("http://www.w3.org/2000/svg", "cl
ipPath"); | |
4 clipPathElement.setAttribute("clipPathUnits", "userSpaceOnUse"); | |
5 | |
6 debug(""); | |
7 debug("Check initial 'clipPathUnits' value"); | |
8 shouldBeEqualToString("clipPathElement.clipPathUnits.toString()", "[object SVGAn
imatedEnumeration]"); | |
9 shouldBeEqualToString("typeof(clipPathElement.clipPathUnits.baseVal)", "number")
; | |
10 shouldBe("clipPathElement.clipPathUnits.baseVal", "SVGUnitTypes.SVG_UNIT_TYPE_US
ERSPACEONUSE"); | |
11 | |
12 debug(""); | |
13 debug("Switch to 'objectBoundingBox'"); | |
14 shouldBe("clipPathElement.clipPathUnits.baseVal = SVGUnitTypes.SVG_UNIT_TYPE_OBJ
ECTBOUNDINGBOX", "SVGUnitTypes.SVG_UNIT_TYPE_OBJECTBOUNDINGBOX"); | |
15 shouldBe("clipPathElement.clipPathUnits.baseVal", "SVGUnitTypes.SVG_UNIT_TYPE_OB
JECTBOUNDINGBOX"); | |
16 shouldBeEqualToString("clipPathElement.getAttribute('clipPathUnits')", "objectBo
undingBox"); | |
17 | |
18 debug(""); | |
19 debug("Try setting invalid values"); | |
20 shouldThrow("clipPathElement.clipPathUnits.baseVal = 3"); | |
21 shouldBe("clipPathElement.clipPathUnits.baseVal", "SVGUnitTypes.SVG_UNIT_TYPE_OB
JECTBOUNDINGBOX"); | |
22 shouldBeEqualToString("clipPathElement.getAttribute('clipPathUnits')", "objectBo
undingBox"); | |
23 | |
24 shouldThrow("clipPathElement.clipPathUnits.baseVal = -1"); | |
25 shouldBe("clipPathElement.clipPathUnits.baseVal", "SVGUnitTypes.SVG_UNIT_TYPE_OB
JECTBOUNDINGBOX"); | |
26 shouldBeEqualToString("clipPathElement.getAttribute('clipPathUnits')", "objectBo
undingBox"); | |
27 | |
28 shouldThrow("clipPathElement.clipPathUnits.baseVal = 0"); | |
29 shouldBe("clipPathElement.clipPathUnits.baseVal", "SVGUnitTypes.SVG_UNIT_TYPE_OB
JECTBOUNDINGBOX"); | |
30 shouldBeEqualToString("clipPathElement.getAttribute('clipPathUnits')", "objectBo
undingBox"); | |
31 | |
32 debug(""); | |
33 debug("Switch to 'userSpaceOnUse'"); | |
34 shouldBe("clipPathElement.clipPathUnits.baseVal = SVGUnitTypes.SVG_UNIT_TYPE_USE
RSPACEONUSE", "SVGUnitTypes.SVG_UNIT_TYPE_USERSPACEONUSE"); | |
35 shouldBe("clipPathElement.clipPathUnits.baseVal", "SVGUnitTypes.SVG_UNIT_TYPE_US
ERSPACEONUSE"); | |
36 shouldBeEqualToString("clipPathElement.getAttribute('clipPathUnits')", "userSpac
eOnUse"); | |
37 | |
38 successfullyParsed = true; | |
OLD | NEW |