OLD | NEW |
(Empty) | |
| 1 <!DOCTYPE html> |
| 2 <html> |
| 3 <head> |
| 4 <link rel="help" href="http://www.w3.org/TR/2013/WD-SVG2-20130618/" /> |
| 5 <script src="../../fast/js/resources/js-test-pre.js"></script> |
| 6 </head> |
| 7 <body> |
| 8 <script> |
| 9 description("Validates the SVG2 inheritance model."); |
| 10 |
| 11 function checkParent(type, expectedParent) |
| 12 { |
| 13 // Using shouldBe() would lead to not very readable output here. |
| 14 if (!window[type]) { |
| 15 testFailed(type + " is not defined"); |
| 16 return; |
| 17 } |
| 18 var parentPrototype = window[type].prototype.__proto__; |
| 19 var expectedPrototype = window[expectedParent] ? window[expectedParent].prot
otype : null; |
| 20 |
| 21 if (expectedPrototype && parentPrototype === expectedPrototype) |
| 22 testPassed(type + " inherits " + expectedParent); |
| 23 else |
| 24 testFailed(type + " should inherit " + expectedParent + " but got " + pa
rentPrototype.constructor.name + " instead"); |
| 25 } |
| 26 |
| 27 checkParent("SVGAElement", "SVGGraphicsElement"); |
| 28 checkParent("SVGAltGlyphDefElement", "SVGElement"); |
| 29 checkParent("SVGAltGlyphElement", "SVGTextPositioningElement"); |
| 30 checkParent("SVGAltGlyphItemElement", "SVGElement"); |
| 31 checkParent("SVGAngle", "Object"); |
| 32 checkParent("SVGAnimateColorElement", "SVGAnimationElement"); |
| 33 checkParent("SVGAnimateElement", "SVGAnimationElement"); |
| 34 checkParent("SVGAnimateMotionElement", "SVGAnimationElement"); |
| 35 checkParent("SVGAnimateTransformElement", "SVGAnimationElement"); |
| 36 checkParent("SVGAnimatedAngle", "Object"); |
| 37 checkParent("SVGAnimatedBoolean", "Object"); |
| 38 checkParent("SVGAnimatedEnumeration", "Object"); |
| 39 checkParent("SVGAnimatedInteger", "Object"); |
| 40 checkParent("SVGAnimatedLength", "Object"); |
| 41 checkParent("SVGAnimatedLengthList", "Object"); |
| 42 checkParent("SVGAnimatedNumber", "Object"); |
| 43 checkParent("SVGAnimatedNumberList", "Object"); |
| 44 checkParent("SVGAnimatedPathData", "Object"); |
| 45 checkParent("SVGAnimatedPreserveAspectRatio", "Object"); |
| 46 checkParent("SVGAnimatedRect", "Object"); |
| 47 checkParent("SVGAnimatedString", "Object"); |
| 48 checkParent("SVGAnimatedTransformList", "Object"); |
| 49 checkParent("SVGAnimationElement", "SVGElement"); |
| 50 checkParent("SVGCSSRule", "CSSRule"); |
| 51 checkParent("SVGCircleElement", "SVGGeometryElement"); |
| 52 checkParent("SVGClipPathElement", "SVGDefinitionElement"); |
| 53 checkParent("SVGColorProfileElement", "SVGElement"); |
| 54 checkParent("SVGColorProfileRule", "SVGCSSRule"); |
| 55 checkParent("SVGCursorElement", "SVGElement"); |
| 56 checkParent("SVGDefsElement", "SVGGraphicsElement"); |
| 57 checkParent("SVGDescElement", "SVGElement"); |
| 58 checkParent("SVGElement", "Element"); |
| 59 checkParent("SVGElementInstance", "EventTarget"); |
| 60 checkParent("SVGElementInstanceList", "Object"); |
| 61 checkParent("SVGEllipseElement", "SVGGeometryElement"); |
| 62 checkParent("SVGFontElement", "SVGElement"); |
| 63 checkParent("SVGFontFaceElement", "SVGElement"); |
| 64 checkParent("SVGFontFaceFormatElement", "SVGElement"); |
| 65 checkParent("SVGFontFaceNameElement", "SVGElement"); |
| 66 checkParent("SVGFontFaceSrcElement", "SVGElement"); |
| 67 checkParent("SVGFontFaceUriElement", "SVGElement"); |
| 68 checkParent("SVGForeignObjectElement", "SVGGraphicsElement"); |
| 69 checkParent("SVGGElement", "SVGGraphicsElement"); |
| 70 checkParent("SVGGeometryElement", "SVGGraphicsElement"); |
| 71 checkParent("SVGGlyphElement", "SVGElement"); |
| 72 checkParent("SVGGlyphRefElement", "SVGElement"); |
| 73 checkParent("SVGGradientElement", "SVGElement"); |
| 74 checkParent("SVGGraphicsElement", "SVGElement"); |
| 75 checkParent("SVGHKernElement", "SVGElement"); |
| 76 checkParent("SVGImageElement", "SVGGraphicsElement"); |
| 77 checkParent("SVGLength", "Object"); |
| 78 checkParent("SVGLengthList", "Object"); |
| 79 checkParent("SVGLineElement", "SVGGeometryElement"); |
| 80 checkParent("SVGLinearGradientElement", "SVGGradientElement"); |
| 81 checkParent("SVGMPathElement", "SVGElement"); |
| 82 checkParent("SVGMarkerElement", "SVGElement"); |
| 83 checkParent("SVGMarkerInstance", "Object"); |
| 84 checkParent("SVGMarkerList", "Object"); |
| 85 checkParent("SVGMaskElement", "SVGDefinitionElement"); |
| 86 checkParent("SVGMatrix", "Object"); |
| 87 checkParent("SVGMeshGradientElement", "SVGGradientElement"); |
| 88 checkParent("SVGMeshPatchElement", "SVGElement"); |
| 89 checkParent("SVGMeshRowElement", "SVGElement"); |
| 90 checkParent("SVGMetadataElement", "SVGElement"); |
| 91 checkParent("SVGMissingGlyphElement", "SVGElement"); |
| 92 checkParent("SVGNumber", "Object"); |
| 93 checkParent("SVGNumberList", "Object"); |
| 94 checkParent("SVGPathElement", "SVGGeometryElement"); |
| 95 checkParent("SVGPathSeg", "Object"); |
| 96 checkParent("SVGPathSegArcAbs", "SVGPathSeg"); |
| 97 checkParent("SVGPathSegArcRel", "SVGPathSeg"); |
| 98 checkParent("SVGPathSegClosePath", "SVGPathSeg"); |
| 99 checkParent("SVGPathSegCurvetoCubicAbs", "SVGPathSeg"); |
| 100 checkParent("SVGPathSegCurvetoCubicRel", "SVGPathSeg"); |
| 101 checkParent("SVGPathSegCurvetoCubicSmoothAbs", "SVGPathSeg"); |
| 102 checkParent("SVGPathSegCurvetoCubicSmoothRel", "SVGPathSeg"); |
| 103 checkParent("SVGPathSegCurvetoQuadraticAbs", "SVGPathSeg"); |
| 104 checkParent("SVGPathSegCurvetoQuadraticRel", "SVGPathSeg"); |
| 105 checkParent("SVGPathSegCurvetoQuadraticSmoothAbs", "SVGPathSeg"); |
| 106 checkParent("SVGPathSegCurvetoQuadraticSmoothRel", "SVGPathSeg"); |
| 107 checkParent("SVGPathSegLinetoAbs", "SVGPathSeg"); |
| 108 checkParent("SVGPathSegLinetoHorizontalAbs", "SVGPathSeg"); |
| 109 checkParent("SVGPathSegLinetoHorizontalRel", "SVGPathSeg"); |
| 110 checkParent("SVGPathSegLinetoRel", "SVGPathSeg"); |
| 111 checkParent("SVGPathSegLinetoVerticalAbs", "SVGPathSeg"); |
| 112 checkParent("SVGPathSegLinetoVerticalRel", "SVGPathSeg"); |
| 113 checkParent("SVGPathSegList", "Object"); |
| 114 checkParent("SVGPathSegMovetoAbs", "SVGPathSeg"); |
| 115 checkParent("SVGPathSegMovetoRel", "SVGPathSeg"); |
| 116 checkParent("SVGPatternElement", "SVGElement"); |
| 117 checkParent("SVGPoint", "Object"); |
| 118 checkParent("SVGPointList", "Object"); |
| 119 checkParent("SVGPolygonElement", "SVGGeometryElement"); |
| 120 checkParent("SVGPolylineElement", "SVGGeometryElement"); |
| 121 checkParent("SVGPreserveAspectRatio", "Object"); |
| 122 checkParent("SVGRadialGradientElement", "SVGGradientElement"); |
| 123 checkParent("SVGRect", "Object"); |
| 124 checkParent("SVGRectElement", "SVGGeometryElement"); |
| 125 checkParent("SVGSVGElement", "SVGGraphicsElement"); |
| 126 checkParent("SVGScriptElement", "SVGElement"); |
| 127 checkParent("SVGSetElement", "SVGAnimationElement"); |
| 128 checkParent("SVGStopElement", "SVGElement"); |
| 129 checkParent("SVGStringList", "Object"); |
| 130 checkParent("SVGStyleElement", "SVGElement"); |
| 131 checkParent("SVGSwitchElement", "SVGGraphicsElement"); |
| 132 checkParent("SVGSymbolElement", "SVGElement"); |
| 133 checkParent("SVGTRefElement", "SVGTextPositioningElement"); |
| 134 checkParent("SVGTSpanElement", "SVGTextPositioningElement"); |
| 135 checkParent("SVGTextContentElement", "SVGGraphicsElement"); |
| 136 checkParent("SVGTextElement", "SVGTextPositioningElement"); |
| 137 checkParent("SVGTextPathElement", "SVGTextContentElement"); |
| 138 checkParent("SVGTextPositioningElement", "SVGTextContentElement"); |
| 139 checkParent("SVGTitleElement", "SVGElement"); |
| 140 checkParent("SVGTransform", "Object"); |
| 141 checkParent("SVGTransformList", "Object"); |
| 142 checkParent("SVGUseElement", "SVGGraphicsElement"); |
| 143 checkParent("SVGVKernElement", "SVGElement"); |
| 144 checkParent("SVGViewElement", "SVGElement"); |
| 145 checkParent("SVGViewSpec", "Object"); |
| 146 checkParent("SVGZoomEvent", "UIEvent"); |
| 147 checkParent("TimeEvent", "Event"); |
| 148 </script> |
| 149 <script src="../../fast/js/resources/js-test-post.js"></script> |
| 150 </body> |
| 151 </html> |
OLD | NEW |