blob: da864a11d7eb00997f8400fa93d7a33dde3eb75b [file] [log] [blame]
<?xml version="1.0" encoding="UTF-8"?>
<svg xmlns="http://www.w3.org/2000/svg" onload="runTest()">
<script type="text/ecmascript"><![CDATA[
if (window.layoutTestController)
layoutTestController.dumpAsText();
function expect(string, val) {
var b = eval(string) == val;
var message = (string + "") + " " + (b ? "PASSED" : "FAILED (actual: '" + eval(string) + "' expected: '" + val + "')");
var txt = document.createElementNS("http://www.w3.org/2000/svg", "text");
var textNode = document.createTextNode(message);
txt.appendChild(textNode);
document.rootElement.appendChild(txt);
}
function expect_failure(string, val) {
var b;
try { b = eval(string); } catch(e) { }
var message = (string + "") + " " + "EXPECTED FAILURE (actual: '" + b + "' expected: '" + val + "')";
var txt = document.createElementNS("http://www.w3.org/2000/svg", "text");
var textNode = document.createTextNode(message);
txt.appendChild(textNode);
document.rootElement.appendChild(txt);
}
function runTest() {
expect("SVGAngle.SVG_ANGLETYPE_UNKNOWN", 0);
expect("SVGAngle.SVG_ANGLETYPE_UNSPECIFIED", 1);
expect("SVGAngle.SVG_ANGLETYPE_DEG", 2);
expect("SVGAngle.SVG_ANGLETYPE_RAD", 3);
expect("SVGAngle.SVG_ANGLETYPE_GRAD", 4)
expect("SVGColor.SVG_COLORTYPE_UNKNOWN", 0);
expect("SVGColor.SVG_COLORTYPE_RGBCOLOR", 1);
expect("SVGColor.SVG_COLORTYPE_RGBCOLOR_ICCCOLOR", 2);
expect("SVGColor.SVG_COLORTYPE_CURRENTCOLOR", 3);
if (window.SVGComponentTransferFunctionElement) {
expect("SVGComponentTransferFunctionElement.SVG_FECOMPONENTTRANSFER_TYPE_UNKNOWN", 0);
expect("SVGComponentTransferFunctionElement.SVG_FECOMPONENTTRANSFER_TYPE_IDENTITY", 1);
expect("SVGComponentTransferFunctionElement.SVG_FECOMPONENTTRANSFER_TYPE_TABLE", 2);
expect("SVGComponentTransferFunctionElement.SVG_FECOMPONENTTRANSFER_TYPE_DISCRETE", 3);
expect("SVGComponentTransferFunctionElement.SVG_FECOMPONENTTRANSFER_TYPE_LINEAR", 4);
expect("SVGComponentTransferFunctionElement.SVG_FECOMPONENTTRANSFER_TYPE_GAMMA", 5);
}
expect_failure("SVGCSSRule.COLOR_PROFILE_RULE", 7);
expect("SVGException.SVG_WRONG_TYPE_ERR", 0);
expect("SVGException.SVG_INVALID_VALUE_ERR", 1);
expect("SVGException.SVG_MATRIX_NOT_INVERTABLE", 2);
if (window.SVGComponentTransferFunctionElement) {
expect("SVGFEBlendElement.SVG_FEBLEND_MODE_UNKNOWN", 0);
expect("SVGFEBlendElement.SVG_FEBLEND_MODE_NORMAL", 1); // Highlights a HASH bug!
expect("SVGFEBlendElement.SVG_FEBLEND_MODE_MULTIPLY", 2);
expect("SVGFEBlendElement.SVG_FEBLEND_MODE_SCREEN", 3);
expect("SVGFEBlendElement.SVG_FEBLEND_MODE_DARKEN", 4);
expect("SVGFEBlendElement.SVG_FEBLEND_MODE_LIGHTEN", 5);
}
if (window.SVGFEColorMatrixElement) {
expect("SVGFEColorMatrixElement.SVG_FECOLORMATRIX_TYPE_UNKNOWN", 0);
expect("SVGFEColorMatrixElement.SVG_FECOLORMATRIX_TYPE_MATRIX", 1);
expect("SVGFEColorMatrixElement.SVG_FECOLORMATRIX_TYPE_SATURATE", 2);
expect("SVGFEColorMatrixElement.SVG_FECOLORMATRIX_TYPE_HUEROTATE", 3);
expect("SVGFEColorMatrixElement.SVG_FECOLORMATRIX_TYPE_LUMINANCETOALPHA", 4);
}
if (window.SVGFECompositeElement) {
expect("SVGFECompositeElement.SVG_FECOMPOSITE_OPERATOR_UNKNOWN", 0);
expect("SVGFECompositeElement.SVG_FECOMPOSITE_OPERATOR_OVER", 1);
expect("SVGFECompositeElement.SVG_FECOMPOSITE_OPERATOR_IN", 2);
expect("SVGFECompositeElement.SVG_FECOMPOSITE_OPERATOR_OUT", 3);
expect("SVGFECompositeElement.SVG_FECOMPOSITE_OPERATOR_ATOP", 4);
expect("SVGFECompositeElement.SVG_FECOMPOSITE_OPERATOR_XOR", 5);
expect("SVGFECompositeElement.SVG_FECOMPOSITE_OPERATOR_ARITHMETIC", 6);
}
if (window.SVGFEConvolveMatrixElement) {
expect_failure("SVGFEConvolveMatrixElement.SVG_EDGEMODE_UNKNOWN", 0);
expect_failure("SVGFEConvolveMatrixElement.SVG_EDGEMODE_DUPLICATE", 1);
expect_failure("SVGFEConvolveMatrixElement.SVG_EDGEMODE_WRAP", 2);
expect_failure("SVGFEConvolveMatrixElement.SVG_EDGEMODE_NONE", 3);
}
if (window.SVGFEDisplacementMapElement) {
expect("SVGFEDisplacementMapElement.SVG_CHANNEL_UNKNOWN", 0);
expect("SVGFEDisplacementMapElement.SVG_CHANNEL_R", 1);
expect("SVGFEDisplacementMapElement.SVG_CHANNEL_G", 2);
expect("SVGFEDisplacementMapElement.SVG_CHANNEL_B", 3);
expect("SVGFEDisplacementMapElement.SVG_CHANNEL_A", 4);
}
if (window.SVGFEMorphologyElement) {
expect_failure("SVGFEMorphologyElement.SVG_MORPHOLOGY_OPERATOR_UNKNOWN", 0);
expect_failure("SVGFEMorphologyElement.SVG_MORPHOLOGY_OPERATOR_ERODE", 1);
expect_failure("SVGFEMorphologyElement.SVG_MORPHOLOGY_OPERATOR_DILATE", 2);
}
if (window.SVGFETurbulenceElement) {
expect("SVGFETurbulenceElement.SVG_TURBULENCE_TYPE_UNKNOWN", 0);
expect("SVGFETurbulenceElement.SVG_TURBULENCE_TYPE_FRACTALNOISE", 1);
expect("SVGFETurbulenceElement.SVG_TURBULENCE_TYPE_TURBULENCE", 2);
expect("SVGFETurbulenceElement.SVG_STITCHTYPE_UNKNOWN", 0);
expect("SVGFETurbulenceElement.SVG_STITCHTYPE_STITCH", 1);
expect("SVGFETurbulenceElement.SVG_STITCHTYPE_NOSTITCH", 2);
}
expect("SVGGradientElement.SVG_SPREADMETHOD_UNKNOWN", 0);
expect("SVGGradientElement.SVG_SPREADMETHOD_PAD", 1);
expect("SVGGradientElement.SVG_SPREADMETHOD_REFLECT", 2);
expect("SVGGradientElement.SVG_SPREADMETHOD_REPEAT", 3);
expect("SVGLength.SVG_LENGTHTYPE_UNKNOWN", 0);
expect("SVGLength.SVG_LENGTHTYPE_NUMBER", 1);
expect("SVGLength.SVG_LENGTHTYPE_PERCENTAGE", 2);
expect("SVGLength.SVG_LENGTHTYPE_EMS", 3);
expect("SVGLength.SVG_LENGTHTYPE_EXS", 4);
expect("SVGLength.SVG_LENGTHTYPE_PX", 5);
expect("SVGLength.SVG_LENGTHTYPE_CM", 6);
expect("SVGLength.SVG_LENGTHTYPE_MM", 7);
expect("SVGLength.SVG_LENGTHTYPE_IN", 8);
expect("SVGLength.SVG_LENGTHTYPE_PT", 9);
expect("SVGLength.SVG_LENGTHTYPE_PC", 10)
expect("SVGMarkerElement.SVG_MARKERUNITS_UNKNOWN", 0);
expect("SVGMarkerElement.SVG_MARKERUNITS_USERSPACEONUSE", 1);
expect("SVGMarkerElement.SVG_MARKERUNITS_STROKEWIDTH", 2);
expect("SVGMarkerElement.SVG_MARKER_ORIENT_UNKNOWN", 0);
expect("SVGMarkerElement.SVG_MARKER_ORIENT_AUTO", 1);
expect("SVGMarkerElement.SVG_MARKER_ORIENT_ANGLE", 2);
expect("SVGPaint.SVG_PAINTTYPE_UNKNOWN", 0);
expect("SVGPaint.SVG_PAINTTYPE_RGBCOLOR", 1);
expect("SVGPaint.SVG_PAINTTYPE_RGBCOLOR_ICCCOLOR", 2);
expect("SVGPaint.SVG_PAINTTYPE_NONE", 101);
expect("SVGPaint.SVG_PAINTTYPE_CURRENTCOLOR", 102);
expect("SVGPaint.SVG_PAINTTYPE_URI_NONE", 103);
expect("SVGPaint.SVG_PAINTTYPE_URI_CURRENTCOLOR", 104);
expect("SVGPaint.SVG_PAINTTYPE_URI_RGBCOLOR", 105);
expect("SVGPaint.SVG_PAINTTYPE_URI_RGBCOLOR_ICCCOLOR", 106);
expect("SVGPaint.SVG_PAINTTYPE_URI", 107);
expect("SVGPathSeg.PATHSEG_UNKNOWN", 0);
expect("SVGPathSeg.PATHSEG_CLOSEPATH", 1);
expect("SVGPathSeg.PATHSEG_MOVETO_ABS", 2);
expect("SVGPathSeg.PATHSEG_MOVETO_REL", 3);
expect("SVGPathSeg.PATHSEG_LINETO_ABS", 4);
expect("SVGPathSeg.PATHSEG_LINETO_REL", 5);
expect("SVGPathSeg.PATHSEG_CURVETO_CUBIC_ABS", 6);
expect("SVGPathSeg.PATHSEG_CURVETO_CUBIC_REL", 7);
expect("SVGPathSeg.PATHSEG_CURVETO_QUADRATIC_ABS", 8);
expect("SVGPathSeg.PATHSEG_CURVETO_QUADRATIC_REL", 9);
expect("SVGPathSeg.PATHSEG_ARC_ABS", 10);
expect("SVGPathSeg.PATHSEG_ARC_REL", 11);
expect("SVGPathSeg.PATHSEG_LINETO_HORIZONTAL_ABS", 12);
expect("SVGPathSeg.PATHSEG_LINETO_HORIZONTAL_REL", 13);
expect("SVGPathSeg.PATHSEG_LINETO_VERTICAL_ABS", 14);
expect("SVGPathSeg.PATHSEG_LINETO_VERTICAL_REL", 15);
expect("SVGPathSeg.PATHSEG_CURVETO_CUBIC_SMOOTH_ABS", 16);
expect("SVGPathSeg.PATHSEG_CURVETO_CUBIC_SMOOTH_REL", 17);
expect("SVGPathSeg.PATHSEG_CURVETO_QUADRATIC_SMOOTH_ABS", 18);
expect("SVGPathSeg.PATHSEG_CURVETO_QUADRATIC_SMOOTH_REL", 19);
expect("SVGPreserveAspectRatio.SVG_PRESERVEASPECTRATIO_UNKNOWN", 0);
expect("SVGPreserveAspectRatio.SVG_PRESERVEASPECTRATIO_NONE", 1);
expect("SVGPreserveAspectRatio.SVG_PRESERVEASPECTRATIO_XMINYMIN", 2);
expect("SVGPreserveAspectRatio.SVG_PRESERVEASPECTRATIO_XMIDYMIN", 3);
expect("SVGPreserveAspectRatio.SVG_PRESERVEASPECTRATIO_XMAXYMIN", 4);
expect("SVGPreserveAspectRatio.SVG_PRESERVEASPECTRATIO_XMINYMID", 5);
expect("SVGPreserveAspectRatio.SVG_PRESERVEASPECTRATIO_XMIDYMID", 6);
expect("SVGPreserveAspectRatio.SVG_PRESERVEASPECTRATIO_XMAXYMID", 7);
expect("SVGPreserveAspectRatio.SVG_PRESERVEASPECTRATIO_XMINYMAX", 8);
expect("SVGPreserveAspectRatio.SVG_PRESERVEASPECTRATIO_XMIDYMAX", 9);
expect("SVGPreserveAspectRatio.SVG_PRESERVEASPECTRATIO_XMAXYMAX", 10);
expect("SVGPreserveAspectRatio.SVG_MEETORSLICE_UNKNOWN", 0);
expect("SVGPreserveAspectRatio.SVG_MEETORSLICE_MEET", 1);
expect("SVGPreserveAspectRatio.SVG_MEETORSLICE_SLICE", 2);
expect("SVGRenderingIntent.RENDERING_INTENT_UNKNOWN", 0);
expect("SVGRenderingIntent.RENDERING_INTENT_AUTO", 1);
expect("SVGRenderingIntent.RENDERING_INTENT_PERCEPTUAL", 2);
expect("SVGRenderingIntent.RENDERING_INTENT_RELATIVE_COLORIMETRIC", 3);
expect("SVGRenderingIntent.RENDERING_INTENT_SATURATION", 4);
expect("SVGRenderingIntent.RENDERING_INTENT_ABSOLUTE_COLORIMETRIC", 5);
expect("SVGTextContentElement.LENGTHADJUST_UNKNOWN", 0);
expect("SVGTextContentElement.LENGTHADJUST_SPACING", 1);
expect("SVGTextContentElement.LENGTHADJUST_SPACINGANDGLYPHS", 2);
expect("SVGTextPathElement.TEXTPATH_METHODTYPE_UNKNOWN", 0);
expect("SVGTextPathElement.TEXTPATH_METHODTYPE_ALIGN", 1);
expect("SVGTextPathElement.TEXTPATH_METHODTYPE_STRETCH", 2);
expect("SVGTextPathElement.TEXTPATH_SPACINGTYPE_UNKNOWN", 0);
expect("SVGTextPathElement.TEXTPATH_SPACINGTYPE_AUTO", 1);
expect("SVGTextPathElement.TEXTPATH_SPACINGTYPE_EXACT", 2);
expect("SVGTransform.SVG_TRANSFORM_UNKNOWN", 0);
expect("SVGTransform.SVG_TRANSFORM_MATRIX", 1);
expect("SVGTransform.SVG_TRANSFORM_TRANSLATE", 2);
expect("SVGTransform.SVG_TRANSFORM_SCALE", 3);
expect("SVGTransform.SVG_TRANSFORM_ROTATE", 4);
expect("SVGTransform.SVG_TRANSFORM_SKEWX", 5);
expect("SVGTransform.SVG_TRANSFORM_SKEWY", 6);
expect("SVGUnitTypes.SVG_UNIT_TYPE_UNKNOWN", 0);
expect("SVGUnitTypes.SVG_UNIT_TYPE_USERSPACEONUSE", 1);
expect("SVGUnitTypes.SVG_UNIT_TYPE_OBJECTBOUNDINGBOX", 2);
expect_failure("SVGZoomAndPan.SVG_ZOOMANDPAN_UNKNOWN", 0);
expect_failure("SVGZoomAndPan.SVG_ZOOMANDPAN_DISABLE", 1);
expect_failure("SVGZoomAndPan.SVG_ZOOMANDPAN_MAGNIFY", 2);
}
]]></script>
</svg>