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