| OLD | NEW |
| (Empty) |
| 1 description("This test checks the use of SVGAnimatedEnumeration within SVGFEMorp
hologyElement"); | |
| 2 | |
| 3 var feMorphologyElement = document.createElementNS("http://www.w3.org/2000/svg",
"feMorphology"); | |
| 4 feMorphologyElement.setAttribute("operator", "erode"); | |
| 5 | |
| 6 debug(""); | |
| 7 debug("Check initial 'operator' value"); | |
| 8 shouldBeEqualToString("feMorphologyElement.operator.toString()", "[object SVGAni
matedEnumeration]"); | |
| 9 shouldBeEqualToString("typeof(feMorphologyElement.operator.baseVal)", "number"); | |
| 10 shouldBe("feMorphologyElement.operator.baseVal", "SVGFEMorphologyElement.SVG_MOR
PHOLOGY_OPERATOR_ERODE"); | |
| 11 | |
| 12 debug(""); | |
| 13 debug("Switch to 'dilate'"); | |
| 14 shouldBe("feMorphologyElement.operator.baseVal = SVGFEMorphologyElement.SVG_MORP
HOLOGY_OPERATOR_DILATE", "SVGFEMorphologyElement.SVG_MORPHOLOGY_OPERATOR_DILATE"
); | |
| 15 shouldBe("feMorphologyElement.operator.baseVal", "SVGFEMorphologyElement.SVG_MOR
PHOLOGY_OPERATOR_DILATE"); | |
| 16 shouldBeEqualToString("feMorphologyElement.getAttribute('operator')", "dilate"); | |
| 17 | |
| 18 debug(""); | |
| 19 debug("Try setting invalid values"); | |
| 20 shouldThrow("feMorphologyElement.operator.baseVal = 4"); | |
| 21 shouldBe("feMorphologyElement.operator.baseVal", "SVGFEMorphologyElement.SVG_MOR
PHOLOGY_OPERATOR_DILATE"); | |
| 22 shouldBeEqualToString("feMorphologyElement.getAttribute('operator')", "dilate"); | |
| 23 | |
| 24 shouldThrow("feMorphologyElement.operator.baseVal = -1"); | |
| 25 shouldBe("feMorphologyElement.operator.baseVal", "SVGFEMorphologyElement.SVG_MOR
PHOLOGY_OPERATOR_DILATE"); | |
| 26 shouldBeEqualToString("feMorphologyElement.getAttribute('operator')", "dilate"); | |
| 27 | |
| 28 shouldThrow("feMorphologyElement.operator.baseVal = 0"); | |
| 29 shouldBe("feMorphologyElement.operator.baseVal", "SVGFEMorphologyElement.SVG_MOR
PHOLOGY_OPERATOR_DILATE"); | |
| 30 shouldBeEqualToString("feMorphologyElement.getAttribute('operator')", "dilate"); | |
| 31 | |
| 32 debug(""); | |
| 33 debug("Switch to 'erode'"); | |
| 34 shouldBe("feMorphologyElement.operator.baseVal = SVGFEMorphologyElement.SVG_MORP
HOLOGY_OPERATOR_ERODE", "SVGFEMorphologyElement.SVG_MORPHOLOGY_OPERATOR_ERODE"); | |
| 35 shouldBe("feMorphologyElement.operator.baseVal", "SVGFEMorphologyElement.SVG_MOR
PHOLOGY_OPERATOR_ERODE"); | |
| 36 shouldBeEqualToString("feMorphologyElement.getAttribute('operator')", "erode"); | |
| 37 | |
| 38 successfullyParsed = true; | |
| OLD | NEW |