| OLD | NEW |
| (Empty) |
| 1 description("This test checks the use of SVGAnimatedEnumeration within SVGCompon
entTransferFunctionElement"); | |
| 2 | |
| 3 var feFuncRElement = document.createElementNS("http://www.w3.org/2000/svg", "feF
uncR"); | |
| 4 feFuncRElement.setAttribute("type", "identity"); | |
| 5 | |
| 6 debug(""); | |
| 7 debug("Check initial 'type' value"); | |
| 8 shouldBeEqualToString("feFuncRElement.type.toString()", "[object SVGAnimatedEnum
eration]"); | |
| 9 shouldBeEqualToString("typeof(feFuncRElement.type.baseVal)", "number"); | |
| 10 shouldBe("feFuncRElement.type.baseVal", "SVGComponentTransferFunctionElement.SVG
_FECOMPONENTTRANSFER_TYPE_IDENTITY"); | |
| 11 | |
| 12 debug(""); | |
| 13 debug("Switch to 'table'"); | |
| 14 shouldBe("feFuncRElement.type.baseVal = SVGComponentTransferFunctionElement.SVG_
FECOMPONENTTRANSFER_TYPE_TABLE", "SVGComponentTransferFunctionElement.SVG_FECOMP
ONENTTRANSFER_TYPE_TABLE"); | |
| 15 shouldBe("feFuncRElement.type.baseVal", "SVGComponentTransferFunctionElement.SVG
_FECOMPONENTTRANSFER_TYPE_TABLE"); | |
| 16 shouldBeEqualToString("feFuncRElement.getAttribute('type')", "table"); | |
| 17 | |
| 18 debug(""); | |
| 19 debug("Switch to 'discrete'"); | |
| 20 shouldBe("feFuncRElement.type.baseVal = SVGComponentTransferFunctionElement.SVG_
FECOMPONENTTRANSFER_TYPE_DISCRETE", "SVGComponentTransferFunctionElement.SVG_FEC
OMPONENTTRANSFER_TYPE_DISCRETE"); | |
| 21 shouldBe("feFuncRElement.type.baseVal", "SVGComponentTransferFunctionElement.SVG
_FECOMPONENTTRANSFER_TYPE_DISCRETE"); | |
| 22 shouldBeEqualToString("feFuncRElement.getAttribute('type')", "discrete"); | |
| 23 | |
| 24 debug(""); | |
| 25 debug("Switch to 'linear'"); | |
| 26 shouldBe("feFuncRElement.type.baseVal = SVGComponentTransferFunctionElement.SVG_
FECOMPONENTTRANSFER_TYPE_LINEAR", "SVGComponentTransferFunctionElement.SVG_FECOM
PONENTTRANSFER_TYPE_LINEAR"); | |
| 27 shouldBe("feFuncRElement.type.baseVal", "SVGComponentTransferFunctionElement.SVG
_FECOMPONENTTRANSFER_TYPE_LINEAR"); | |
| 28 shouldBeEqualToString("feFuncRElement.getAttribute('type')", "linear"); | |
| 29 | |
| 30 debug(""); | |
| 31 debug("Switch to 'gamma'"); | |
| 32 shouldBe("feFuncRElement.type.baseVal = SVGComponentTransferFunctionElement.SVG_
FECOMPONENTTRANSFER_TYPE_GAMMA", "SVGComponentTransferFunctionElement.SVG_FECOMP
ONENTTRANSFER_TYPE_GAMMA"); | |
| 33 shouldBe("feFuncRElement.type.baseVal", "SVGComponentTransferFunctionElement.SVG
_FECOMPONENTTRANSFER_TYPE_GAMMA"); | |
| 34 shouldBeEqualToString("feFuncRElement.getAttribute('type')", "gamma"); | |
| 35 | |
| 36 debug(""); | |
| 37 debug("Try setting invalid values"); | |
| 38 shouldThrow("feFuncRElement.type.baseVal = 6"); | |
| 39 shouldBe("feFuncRElement.type.baseVal", "SVGComponentTransferFunctionElement.SVG
_FECOMPONENTTRANSFER_TYPE_GAMMA"); | |
| 40 shouldBeEqualToString("feFuncRElement.getAttribute('type')", "gamma"); | |
| 41 | |
| 42 shouldThrow("feFuncRElement.type.baseVal = -1"); | |
| 43 shouldBe("feFuncRElement.type.baseVal", "SVGComponentTransferFunctionElement.SVG
_FECOMPONENTTRANSFER_TYPE_GAMMA"); | |
| 44 shouldBeEqualToString("feFuncRElement.getAttribute('type')", "gamma"); | |
| 45 | |
| 46 shouldThrow("feFuncRElement.type.baseVal = 0"); | |
| 47 shouldBe("feFuncRElement.type.baseVal", "SVGComponentTransferFunctionElement.SVG
_FECOMPONENTTRANSFER_TYPE_GAMMA"); | |
| 48 shouldBeEqualToString("feFuncRElement.getAttribute('type')", "gamma"); | |
| 49 | |
| 50 debug(""); | |
| 51 debug("Switch to 'identity'"); | |
| 52 shouldBe("feFuncRElement.type.baseVal = SVGComponentTransferFunctionElement.SVG_
FECOMPONENTTRANSFER_TYPE_IDENTITY", "SVGComponentTransferFunctionElement.SVG_FEC
OMPONENTTRANSFER_TYPE_IDENTITY"); | |
| 53 shouldBe("feFuncRElement.type.baseVal", "SVGComponentTransferFunctionElement.SVG
_FECOMPONENTTRANSFER_TYPE_IDENTITY"); | |
| 54 shouldBeEqualToString("feFuncRElement.getAttribute('type')", "identity"); | |
| 55 | |
| 56 successfullyParsed = true; | |
| OLD | NEW |