| OLD | NEW |
| (Empty) |
| 1 description("This test checks the use of SVGAnimatedEnumeration within SVGFEColo
rMatrixElement"); | |
| 2 | |
| 3 var feColorMatrixElement = document.createElementNS("http://www.w3.org/2000/svg"
, "feColorMatrix"); | |
| 4 feColorMatrixElement.setAttribute("type", "matrix"); | |
| 5 | |
| 6 debug(""); | |
| 7 debug("Check initial 'type; value"); | |
| 8 shouldBeEqualToString("feColorMatrixElement.type.toString()", "[object SVGAnimat
edEnumeration]"); | |
| 9 shouldBeEqualToString("typeof(feColorMatrixElement.type.baseVal)", "number"); | |
| 10 shouldBe("feColorMatrixElement.type.baseVal", "SVGFEColorMatrixElement.SVG_FECOL
ORMATRIX_TYPE_MATRIX"); | |
| 11 | |
| 12 debug(""); | |
| 13 debug("Switch to 'saturate'"); | |
| 14 shouldBe("feColorMatrixElement.type.baseVal = SVGFEColorMatrixElement.SVG_FECOLO
RMATRIX_TYPE_SATURATE", "SVGFEColorMatrixElement.SVG_FECOLORMATRIX_TYPE_SATURATE
"); | |
| 15 shouldBe("feColorMatrixElement.type.baseVal", "SVGFEColorMatrixElement.SVG_FECOL
ORMATRIX_TYPE_SATURATE"); | |
| 16 shouldBeEqualToString("feColorMatrixElement.getAttribute('type')", "saturate"); | |
| 17 | |
| 18 debug(""); | |
| 19 debug("Switch to 'hueRotate'"); | |
| 20 shouldBe("feColorMatrixElement.type.baseVal = SVGFEColorMatrixElement.SVG_FECOLO
RMATRIX_TYPE_HUEROTATE", "SVGFEColorMatrixElement.SVG_FECOLORMATRIX_TYPE_HUEROTA
TE"); | |
| 21 shouldBe("feColorMatrixElement.type.baseVal", "SVGFEColorMatrixElement.SVG_FECOL
ORMATRIX_TYPE_HUEROTATE"); | |
| 22 shouldBeEqualToString("feColorMatrixElement.getAttribute('type')", "hueRotate"); | |
| 23 | |
| 24 debug(""); | |
| 25 debug("Switch to 'luminanceToAlpha'"); | |
| 26 shouldBe("feColorMatrixElement.type.baseVal = SVGFEColorMatrixElement.SVG_FECOLO
RMATRIX_TYPE_LUMINANCETOALPHA", "SVGFEColorMatrixElement.SVG_FECOLORMATRIX_TYPE_
LUMINANCETOALPHA"); | |
| 27 shouldBe("feColorMatrixElement.type.baseVal", "SVGFEColorMatrixElement.SVG_FECOL
ORMATRIX_TYPE_LUMINANCETOALPHA"); | |
| 28 shouldBeEqualToString("feColorMatrixElement.getAttribute('type')", "luminanceToA
lpha"); | |
| 29 | |
| 30 debug(""); | |
| 31 debug("Try setting invalid values"); | |
| 32 shouldThrow("feColorMatrixElement.type.baseVal = 5"); | |
| 33 shouldBe("feColorMatrixElement.type.baseVal", "SVGFEColorMatrixElement.SVG_FECOL
ORMATRIX_TYPE_LUMINANCETOALPHA"); | |
| 34 shouldBeEqualToString("feColorMatrixElement.getAttribute('type')", "luminanceToA
lpha"); | |
| 35 | |
| 36 shouldThrow("feColorMatrixElement.type.baseVal = -1"); | |
| 37 shouldBe("feColorMatrixElement.type.baseVal", "SVGFEColorMatrixElement.SVG_FECOL
ORMATRIX_TYPE_LUMINANCETOALPHA"); | |
| 38 shouldBeEqualToString("feColorMatrixElement.getAttribute('type')", "luminanceToA
lpha"); | |
| 39 | |
| 40 shouldThrow("feColorMatrixElement.type.baseVal = 0"); | |
| 41 shouldBe("feColorMatrixElement.type.baseVal", "SVGFEColorMatrixElement.SVG_FECOL
ORMATRIX_TYPE_LUMINANCETOALPHA"); | |
| 42 shouldBeEqualToString("feColorMatrixElement.getAttribute('type')", "luminanceToA
lpha"); | |
| 43 | |
| 44 debug(""); | |
| 45 debug("Switch to 'matrix'"); | |
| 46 shouldBe("feColorMatrixElement.type.baseVal = SVGFEColorMatrixElement.SVG_FECOLO
RMATRIX_TYPE_MATRIX", "SVGFEColorMatrixElement.SVG_FECOLORMATRIX_TYPE_MATRIX"); | |
| 47 shouldBe("feColorMatrixElement.type.baseVal", "SVGFEColorMatrixElement.SVG_FECOL
ORMATRIX_TYPE_MATRIX"); | |
| 48 shouldBeEqualToString("feColorMatrixElement.getAttribute('type')", "matrix"); | |
| 49 | |
| 50 successfullyParsed = true; | |
| OLD | NEW |