blob: fff1ab9c94e6229bfd8e4b19a740b8d07d8e5296 [file] [log] [blame]
<!DOCTYPE html>
<html>
<head>
<link rel="help" href="http://www.w3.org/TR/2013/WD-SVG2-20130618/" />
<script src="../../resources/js-test.js"></script>
</head>
<body>
<script>
description("Validates the SVG2 inheritance model.");
function checkParent(type, expectedParent)
{
// Using shouldBe() would lead to not very readable output here.
if (!window[type]) {
testFailed(type + " is not defined");
return;
}
var parentPrototype = window[type].prototype.__proto__;
var expectedPrototype = window[expectedParent] ? window[expectedParent].prototype : null;
if (expectedPrototype && parentPrototype === expectedPrototype)
testPassed(type + " inherits " + expectedParent);
else
testFailed(type + " should inherit " + expectedParent + " but got " + parentPrototype.constructor.name + " instead");
}
checkParent("SVGAElement", "SVGGraphicsElement");
checkParent("SVGAngle", "Object");
checkParent("SVGAnimateColorElement", "SVGAnimationElement");
checkParent("SVGAnimateElement", "SVGAnimationElement");
checkParent("SVGAnimateMotionElement", "SVGAnimationElement");
checkParent("SVGAnimateTransformElement", "SVGAnimationElement");
checkParent("SVGAnimatedAngle", "Object");
checkParent("SVGAnimatedBoolean", "Object");
checkParent("SVGAnimatedEnumeration", "Object");
checkParent("SVGAnimatedInteger", "Object");
checkParent("SVGAnimatedLength", "Object");
checkParent("SVGAnimatedLengthList", "Object");
checkParent("SVGAnimatedNumber", "Object");
checkParent("SVGAnimatedNumberList", "Object");
checkParent("SVGAnimatedPathData", "Object");
checkParent("SVGAnimatedPreserveAspectRatio", "Object");
checkParent("SVGAnimatedRect", "Object");
checkParent("SVGAnimatedString", "Object");
checkParent("SVGAnimatedTransformList", "Object");
checkParent("SVGAnimationElement", "SVGElement");
checkParent("SVGCSSRule", "CSSRule");
checkParent("SVGCircleElement", "SVGGeometryElement");
checkParent("SVGClipPathElement", "SVGElement");
checkParent("SVGColorProfileElement", "SVGElement");
checkParent("SVGColorProfileRule", "SVGCSSRule");
checkParent("SVGCursorElement", "SVGElement");
checkParent("SVGDefsElement", "SVGGraphicsElement");
checkParent("SVGDescElement", "SVGElement");
checkParent("SVGElement", "Element");
checkParent("SVGEllipseElement", "SVGGeometryElement");
checkParent("SVGForeignObjectElement", "SVGGraphicsElement");
checkParent("SVGGElement", "SVGGraphicsElement");
checkParent("SVGGeometryElement", "SVGGraphicsElement");
checkParent("SVGGradientElement", "SVGElement");
checkParent("SVGGraphicsElement", "SVGElement");
checkParent("SVGImageElement", "SVGGraphicsElement");
checkParent("SVGLength", "Object");
checkParent("SVGLengthList", "Object");
checkParent("SVGLineElement", "SVGGeometryElement");
checkParent("SVGLinearGradientElement", "SVGGradientElement");
checkParent("SVGMPathElement", "SVGElement");
checkParent("SVGMarkerElement", "SVGElement");
checkParent("SVGMarkerInstance", "Object");
checkParent("SVGMarkerList", "Object");
checkParent("SVGMaskElement", "SVGElement");
checkParent("SVGMatrix", "Object");
checkParent("SVGMeshGradientElement", "SVGGradientElement");
checkParent("SVGMeshPatchElement", "SVGElement");
checkParent("SVGMeshRowElement", "SVGElement");
checkParent("SVGMetadataElement", "SVGElement");
checkParent("SVGNumber", "Object");
checkParent("SVGNumberList", "Object");
checkParent("SVGPathElement", "SVGGeometryElement");
checkParent("SVGPatternElement", "SVGElement");
checkParent("SVGPoint", "Object");
checkParent("SVGPointList", "Object");
checkParent("SVGPolygonElement", "SVGGeometryElement");
checkParent("SVGPolylineElement", "SVGGeometryElement");
checkParent("SVGPreserveAspectRatio", "Object");
checkParent("SVGRadialGradientElement", "SVGGradientElement");
checkParent("SVGRect", "Object");
checkParent("SVGRectElement", "SVGGeometryElement");
checkParent("SVGSVGElement", "SVGGraphicsElement");
checkParent("SVGScriptElement", "SVGElement");
checkParent("SVGSetElement", "SVGAnimationElement");
checkParent("SVGStopElement", "SVGElement");
checkParent("SVGStringList", "Object");
checkParent("SVGStyleElement", "SVGElement");
checkParent("SVGSwitchElement", "SVGGraphicsElement");
checkParent("SVGSymbolElement", "SVGElement");
checkParent("SVGTSpanElement", "SVGTextPositioningElement");
checkParent("SVGTextContentElement", "SVGGraphicsElement");
checkParent("SVGTextElement", "SVGTextPositioningElement");
checkParent("SVGTextPathElement", "SVGTextContentElement");
checkParent("SVGTextPositioningElement", "SVGTextContentElement");
checkParent("SVGTitleElement", "SVGElement");
checkParent("SVGTransform", "Object");
checkParent("SVGTransformList", "Object");
checkParent("SVGUseElement", "SVGGraphicsElement");
checkParent("SVGViewElement", "SVGElement");
checkParent("SVGViewSpec", "Object");
checkParent("TimeEvent", "Event");
</script>
</body>
</html>