OLD | NEW |
| (Empty) |
1 description("This test checks the use of SVGAnimatedEnumeration within SVGFEConv
olveMatrixElement"); | |
2 | |
3 var feConvolveMatrixElement = document.createElementNS("http://www.w3.org/2000/s
vg", "feConvolveMatrix"); | |
4 feConvolveMatrixElement.setAttribute("edgeMode", "duplicate"); | |
5 | |
6 debug(""); | |
7 debug("Check initial 'edgeMode' value"); | |
8 shouldBeEqualToString("feConvolveMatrixElement.edgeMode.toString()", "[object SV
GAnimatedEnumeration]"); | |
9 shouldBeEqualToString("typeof(feConvolveMatrixElement.edgeMode.baseVal)", "numbe
r"); | |
10 shouldBe("feConvolveMatrixElement.edgeMode.baseVal", "SVGFEConvolveMatrixElement
.SVG_EDGEMODE_DUPLICATE"); | |
11 | |
12 debug(""); | |
13 debug("Switch to 'wrap'"); | |
14 shouldBe("feConvolveMatrixElement.edgeMode.baseVal = SVGFEConvolveMatrixElement.
SVG_EDGEMODE_WRAP", "SVGFEConvolveMatrixElement.SVG_EDGEMODE_WRAP"); | |
15 shouldBe("feConvolveMatrixElement.edgeMode.baseVal", "SVGFEConvolveMatrixElement
.SVG_EDGEMODE_WRAP"); | |
16 shouldBeEqualToString("feConvolveMatrixElement.getAttribute('edgeMode')", "wrap"
); | |
17 | |
18 debug(""); | |
19 debug("Switch to 'none'"); | |
20 shouldBe("feConvolveMatrixElement.edgeMode.baseVal = SVGFEConvolveMatrixElement.
SVG_EDGEMODE_NONE", "SVGFEConvolveMatrixElement.SVG_EDGEMODE_NONE"); | |
21 shouldBe("feConvolveMatrixElement.edgeMode.baseVal", "SVGFEConvolveMatrixElement
.SVG_EDGEMODE_NONE"); | |
22 shouldBeEqualToString("feConvolveMatrixElement.getAttribute('edgeMode')", "none"
); | |
23 | |
24 debug(""); | |
25 debug("Try setting invalid values"); | |
26 shouldThrow("feConvolveMatrixElement.edgeMode.baseVal = 4"); | |
27 shouldBe("feConvolveMatrixElement.edgeMode.baseVal", "SVGFEConvolveMatrixElement
.SVG_EDGEMODE_NONE"); | |
28 shouldBeEqualToString("feConvolveMatrixElement.getAttribute('edgeMode')", "none"
); | |
29 | |
30 shouldThrow("feConvolveMatrixElement.edgeMode.baseVal = -1"); | |
31 shouldBe("feConvolveMatrixElement.edgeMode.baseVal", "SVGFEConvolveMatrixElement
.SVG_EDGEMODE_NONE"); | |
32 shouldBeEqualToString("feConvolveMatrixElement.getAttribute('edgeMode')", "none"
); | |
33 | |
34 shouldThrow("feConvolveMatrixElement.edgeMode.baseVal = 0"); | |
35 shouldBe("feConvolveMatrixElement.edgeMode.baseVal", "SVGFEConvolveMatrixElement
.SVG_EDGEMODE_NONE"); | |
36 shouldBeEqualToString("feConvolveMatrixElement.getAttribute('edgeMode')", "none"
); | |
37 | |
38 debug(""); | |
39 debug("Switch to 'duplicate'"); | |
40 shouldBe("feConvolveMatrixElement.edgeMode.baseVal = SVGFEConvolveMatrixElement.
SVG_EDGEMODE_DUPLICATE", "SVGFEConvolveMatrixElement.SVG_EDGEMODE_DUPLICATE"); | |
41 shouldBe("feConvolveMatrixElement.edgeMode.baseVal", "SVGFEConvolveMatrixElement
.SVG_EDGEMODE_DUPLICATE"); | |
42 shouldBeEqualToString("feConvolveMatrixElement.getAttribute('edgeMode')", "dupli
cate"); | |
43 | |
44 successfullyParsed = true; | |
OLD | NEW |