This appendix is normative.
This appendix contains the complete Web IDL for the SVG Document Object Model definitions.
[Exposed=Window] interfaceSVGElement: Element { [SameObject] readonly attribute SVGAnimatedString className; readonly attribute SVGSVGElement? ownerSVGElement; readonly attribute SVGElement? viewportElement; }; SVGElement includes GlobalEventHandlers; SVGElement includes HTMLOrSVGOrMathMLElement; dictionarySVGBoundingBoxOptions{ booleanfill= true; booleanstroke= false; booleanmarkers= false; booleanclipped= false; }; [Exposed=Window] interfaceSVGGraphicsElement: SVGElement { [SameObject] readonly attribute SVGAnimatedTransformList transform; SVGRect getBBox(optional SVGBoundingBoxOptionsoptions= {}); SVGMatrix? getCTM(); SVGMatrix? getScreenCTM(); }; SVGGraphicsElement includes SVGTests; [Exposed=Window] interfaceSVGGeometryElement: SVGGraphicsElement { [SameObject] readonly attribute SVGAnimatedNumber pathLength; boolean isPointInFill(optional DOMPointInitpoint= {}); boolean isPointInStroke(optional DOMPointInitpoint= {}); float getTotalLength(); SVGPoint getPointAtLength(floatdistance); }; [Exposed=Window] interfaceSVGNumber{ attribute float value; }; [Exposed=Window] interfaceSVGLength{ // Length Unit Types const unsigned short SVG_LENGTHTYPE_UNKNOWN = 0; const unsigned short SVG_LENGTHTYPE_NUMBER = 1; const unsigned short SVG_LENGTHTYPE_PERCENTAGE = 2; const unsigned short SVG_LENGTHTYPE_EMS = 3; const unsigned short SVG_LENGTHTYPE_EXS = 4; const unsigned short SVG_LENGTHTYPE_PX = 5; const unsigned short SVG_LENGTHTYPE_CM = 6; const unsigned short SVG_LENGTHTYPE_MM = 7; const unsigned short SVG_LENGTHTYPE_IN = 8; const unsigned short SVG_LENGTHTYPE_PT = 9; const unsigned short SVG_LENGTHTYPE_PC = 10; readonly attribute unsigned short unitType; attribute float value; attribute float valueInSpecifiedUnits; attribute DOMString valueAsString; undefined newValueSpecifiedUnits(unsigned shortunitType, floatvalueInSpecifiedUnits); undefined convertToSpecifiedUnits(unsigned shortunitType); }; [Exposed=Window] interfaceSVGAngle{ // Angle Unit Types const unsigned short SVG_ANGLETYPE_UNKNOWN = 0; const unsigned short SVG_ANGLETYPE_UNSPECIFIED = 1; const unsigned short SVG_ANGLETYPE_DEG = 2; const unsigned short SVG_ANGLETYPE_RAD = 3; const unsigned short SVG_ANGLETYPE_GRAD = 4; readonly attribute unsigned short unitType; attribute float value; attribute float valueInSpecifiedUnits; attribute DOMString valueAsString; undefined newValueSpecifiedUnits(unsigned shortunitType, floatvalueInSpecifiedUnits); undefined convertToSpecifiedUnits(unsigned shortunitType); }; [Exposed=Window] interfaceSVGNumberList{ readonly attribute unsigned long length; readonly attribute unsigned long numberOfItems; undefined clear(); SVGNumber initialize(SVGNumbernewItem); getter SVGNumber getItem(unsigned longindex); SVGNumber insertItemBefore(SVGNumbernewItem, unsigned longindex); SVGNumber replaceItem(SVGNumbernewItem, unsigned longindex); SVGNumber removeItem(unsigned longindex); SVGNumber appendItem(SVGNumbernewItem); setter undefined (unsigned longindex, SVGNumbernewItem); }; [Exposed=Window] interfaceSVGLengthList{ readonly attribute unsigned long length; readonly attribute unsigned long numberOfItems; undefined clear(); SVGLength initialize(SVGLengthnewItem); getter SVGLength getItem(unsigned longindex); SVGLength insertItemBefore(SVGLengthnewItem, unsigned longindex); SVGLength replaceItem(SVGLengthnewItem, unsigned longindex); SVGLength removeItem(unsigned longindex); SVGLength appendItem(SVGLengthnewItem); setter undefined (unsigned longindex, SVGLengthnewItem); }; [Exposed=Window] interfaceSVGStringList{ readonly attribute unsigned long length; readonly attribute unsigned long numberOfItems; undefined clear(); DOMString initialize(DOMStringnewItem); getter DOMString getItem(unsigned longindex); DOMString insertItemBefore(DOMStringnewItem, unsigned longindex); DOMString replaceItem(DOMStringnewItem, unsigned longindex); DOMString removeItem(unsigned longindex); DOMString appendItem(DOMStringnewItem); setter undefined (unsigned longindex, DOMStringnewItem); }; [Exposed=Window] interfaceSVGAnimatedBoolean{ attribute boolean baseVal; readonly attribute boolean animVal; }; [Exposed=Window] interfaceSVGAnimatedEnumeration{ attribute unsigned short baseVal; readonly attribute unsigned short animVal; }; [Exposed=Window] interfaceSVGAnimatedInteger{ attribute long baseVal; readonly attribute long animVal; }; [Exposed=Window] interfaceSVGAnimatedNumber{ attribute float baseVal; readonly attribute float animVal; }; [Exposed=Window] interfaceSVGAnimatedLength{ [SameObject] readonly attribute SVGLength baseVal; [SameObject] readonly attribute SVGLength animVal; }; [Exposed=Window] interfaceSVGAnimatedAngle{ [SameObject] readonly attribute SVGAngle baseVal; [SameObject] readonly attribute SVGAngle animVal; }; [Exposed=Window] interfaceSVGAnimatedString{ attribute (DOMString or TrustedScriptURL) baseVal; readonly attribute DOMString animVal; }; [Exposed=Window] interfaceSVGAnimatedRect{ [SameObject] readonly attribute SVGRect baseVal; [SameObject] readonly attribute SVGRect animVal; }; [Exposed=Window] interfaceSVGAnimatedNumberList{ [SameObject] readonly attribute SVGNumberList baseVal; [SameObject] readonly attribute SVGNumberList animVal; }; [Exposed=Window] interfaceSVGAnimatedLengthList{ [SameObject] readonly attribute SVGLengthList baseVal; [SameObject] readonly attribute SVGLengthList animVal; }; [Exposed=Window] interfaceSVGUnitTypes{ // Unit Types const unsigned short SVG_UNIT_TYPE_UNKNOWN = 0; const unsigned short SVG_UNIT_TYPE_USERSPACEONUSE = 1; const unsigned short SVG_UNIT_TYPE_OBJECTBOUNDINGBOX = 2; }; interface mixin SVGTests { [SameObject] readonly attribute SVGStringList requiredExtensions; [SameObject] readonly attribute SVGStringList systemLanguage; }; interface mixin SVGFitToViewBox { [SameObject] readonly attribute SVGAnimatedRect viewBox; [SameObject] readonly attribute SVGAnimatedPreserveAspectRatio preserveAspectRatio; }; interface mixin SVGURIReference { [SameObject] readonly attribute SVGAnimatedString href; }; partial interface Document { readonly attribute SVGSVGElement? rootElement; }; [Exposed=Window] interfaceSVGSVGElement: SVGGraphicsElement { [SameObject] readonly attribute SVGAnimatedLength x; [SameObject] readonly attribute SVGAnimatedLength y; [SameObject] readonly attribute SVGAnimatedLength width; [SameObject] readonly attribute SVGAnimatedLength height; attribute float currentScale; [SameObject] readonly attribute SVGPoint currentTranslate; NodeList getIntersectionList(SVGRectrect, SVGElement?referenceElement); NodeList getEnclosureList(SVGRectrect, SVGElement?referenceElement); boolean checkIntersection(SVGElementelement, SVGRectrect); boolean checkEnclosure(SVGElementelement, SVGRectrect); undefined deselectAll(); [NewObject] SVGNumber createSVGNumber(); [NewObject] SVGLength createSVGLength(); [NewObject] SVGAngle createSVGAngle(); [NewObject] SVGPoint createSVGPoint(); [NewObject] SVGMatrix createSVGMatrix(); [NewObject] SVGRect createSVGRect(); [NewObject] SVGTransform createSVGTransform(); [NewObject] SVGTransform createSVGTransformFromMatrix(optional DOMMatrix2DInitmatrix= {}); Element? getElementById(DOMStringelementId); // Deprecated methods that have no effect when called, // but which are kept for compatibility reasons. unsigned long suspendRedraw(unsigned longmaxWaitMilliseconds); undefined unsuspendRedraw(unsigned longsuspendHandleID); undefined unsuspendRedrawAll(); undefined forceRedraw(); }; SVGSVGElement includes SVGFitToViewBox; SVGSVGElement includes WindowEventHandlers; [Exposed=Window] interfaceSVGGElement: SVGGraphicsElement { }; [Exposed=Window] interfaceSVGDefsElement: SVGGraphicsElement { }; [Exposed=Window] interfaceSVGDescElement: SVGElement { }; [Exposed=Window] interfaceSVGMetadataElement: SVGElement { }; [Exposed=Window] interfaceSVGTitleElement: SVGElement { }; [Exposed=Window] interfaceSVGSymbolElement: SVGGraphicsElement { }; SVGSymbolElement includes SVGFitToViewBox; [Exposed=Window] interfaceSVGUseElement: SVGGraphicsElement { [SameObject] readonly attribute SVGAnimatedLength x; [SameObject] readonly attribute SVGAnimatedLength y; [SameObject] readonly attribute SVGAnimatedLength width; [SameObject] readonly attribute SVGAnimatedLength height; }; SVGUseElement includes SVGURIReference; [Exposed=Window] interfaceShadowAnimation: Animation {constructor(Animationsource, (Element or CSSPseudoElement)newTarget); [SameObject] readonly attribute Animation sourceAnimation; }; [Exposed=Window] interfaceSVGSwitchElement: SVGGraphicsElement { }; interface mixin GetSVGDocument { Document getSVGDocument(); }; [Exposed=Window] interfaceSVGStyleElement: SVGElement { [Reflect] attribute DOMStringtype; [Reflect] attribute DOMStringmedia; [Reflect] attribute DOMStringtitle; attribute booleandisabled; }; SVGStyleElement includes LinkStyle; [Exposed=Window] interfaceSVGTransform{ // Transform Types const unsigned short SVG_TRANSFORM_UNKNOWN = 0; const unsigned short SVG_TRANSFORM_MATRIX = 1; const unsigned short SVG_TRANSFORM_TRANSLATE = 2; const unsigned short SVG_TRANSFORM_SCALE = 3; const unsigned short SVG_TRANSFORM_ROTATE = 4; const unsigned short SVG_TRANSFORM_SKEWX = 5; const unsigned short SVG_TRANSFORM_SKEWY = 6; readonly attribute unsigned short type; [SameObject] readonly attribute SVGMatrix matrix; readonly attribute float angle; undefined setMatrix(optional DOMMatrix2DInitmatrix= {}); undefined setTranslate(floattx, floatty); undefined setScale(floatsx, floatsy); undefined setRotate(floatangle, floatcx, floatcy); undefined setSkewX(floatangle); undefined setSkewY(floatangle); }; [Exposed=Window] interfaceSVGTransformList{ readonly attribute unsigned long length; readonly attribute unsigned long numberOfItems; undefined clear(); SVGTransform initialize(SVGTransformnewItem); getter SVGTransform getItem(unsigned longindex); SVGTransform insertItemBefore(SVGTransformnewItem, unsigned longindex); SVGTransform replaceItem(SVGTransformnewItem, unsigned longindex); SVGTransform removeItem(unsigned longindex); SVGTransform appendItem(SVGTransformnewItem); setter undefined (unsigned longindex, SVGTransformnewItem); // Additional methods not common to other list interfaces. SVGTransform createSVGTransformFromMatrix(optional DOMMatrix2DInitmatrix= {}); SVGTransform? consolidate(); }; [Exposed=Window] interfaceSVGAnimatedTransformList{ [SameObject] readonly attribute SVGTransformList baseVal; [SameObject] readonly attribute SVGTransformList animVal; }; [Exposed=Window] interfaceSVGPreserveAspectRatio{ // Alignment Types const unsigned short SVG_PRESERVEASPECTRATIO_UNKNOWN = 0; const unsigned short SVG_PRESERVEASPECTRATIO_NONE = 1; const unsigned short SVG_PRESERVEASPECTRATIO_XMINYMIN = 2; const unsigned short SVG_PRESERVEASPECTRATIO_XMIDYMIN = 3; const unsigned short SVG_PRESERVEASPECTRATIO_XMAXYMIN = 4; const unsigned short SVG_PRESERVEASPECTRATIO_XMINYMID = 5; const unsigned short SVG_PRESERVEASPECTRATIO_XMIDYMID = 6; const unsigned short SVG_PRESERVEASPECTRATIO_XMAXYMID = 7; const unsigned short SVG_PRESERVEASPECTRATIO_XMINYMAX = 8; const unsigned short SVG_PRESERVEASPECTRATIO_XMIDYMAX = 9; const unsigned short SVG_PRESERVEASPECTRATIO_XMAXYMAX = 10; // Meet-or-slice Types const unsigned short SVG_MEETORSLICE_UNKNOWN = 0; const unsigned short SVG_MEETORSLICE_MEET = 1; const unsigned short SVG_MEETORSLICE_SLICE = 2; attribute unsigned short align; attribute unsigned short meetOrSlice; }; [Exposed=Window] interfaceSVGAnimatedPreserveAspectRatio{ [SameObject] readonly attribute SVGPreserveAspectRatio baseVal; [SameObject] readonly attribute SVGPreserveAspectRatio animVal; }; [Exposed=Window] interfaceSVGPathElement: SVGGeometryElement { }; [Exposed=Window] interfaceSVGRectElement: SVGGeometryElement { [SameObject] readonly attribute SVGAnimatedLength x; [SameObject] readonly attribute SVGAnimatedLength y; [SameObject] readonly attribute SVGAnimatedLength width; [SameObject] readonly attribute SVGAnimatedLength height; [SameObject] readonly attribute SVGAnimatedLength rx; [SameObject] readonly attribute SVGAnimatedLength ry; }; [Exposed=Window] interfaceSVGCircleElement: SVGGeometryElement { [SameObject] readonly attribute SVGAnimatedLength cx; [SameObject] readonly attribute SVGAnimatedLength cy; [SameObject] readonly attribute SVGAnimatedLength r; }; [Exposed=Window] interfaceSVGEllipseElement: SVGGeometryElement { [SameObject] readonly attribute SVGAnimatedLength cx; [SameObject] readonly attribute SVGAnimatedLength cy; [SameObject] readonly attribute SVGAnimatedLength rx; [SameObject] readonly attribute SVGAnimatedLength ry; }; [Exposed=Window] interfaceSVGLineElement: SVGGeometryElement { [SameObject] readonly attribute SVGAnimatedLength x1; [SameObject] readonly attribute SVGAnimatedLength y1; [SameObject] readonly attribute SVGAnimatedLength x2; [SameObject] readonly attribute SVGAnimatedLength y2; }; interface mixin SVGAnimatedPoints { [SameObject] readonly attribute SVGPointList points; [SameObject] readonly attribute SVGPointList animatedPoints; }; [Exposed=Window] interfaceSVGPointList{ readonly attribute unsigned long length; readonly attribute unsigned long numberOfItems; undefined clear(); SVGPoint initialize(SVGPointnewItem); getter SVGPoint getItem(unsigned longindex); SVGPoint insertItemBefore(SVGPointnewItem, unsigned longindex); SVGPoint replaceItem(SVGPointnewItem, unsigned longindex); SVGPoint removeItem(unsigned longindex); SVGPoint appendItem(SVGPointnewItem); setter undefined (unsigned longindex, SVGPointnewItem); }; [Exposed=Window] interfaceSVGPolylineElement: SVGGeometryElement { }; SVGPolylineElement includes SVGAnimatedPoints; [Exposed=Window] interfaceSVGPolygonElement: SVGGeometryElement { }; SVGPolygonElement includes SVGAnimatedPoints; [Exposed=Window] interfaceSVGTextContentElement: SVGGraphicsElement { // lengthAdjust Types const unsigned short LENGTHADJUST_UNKNOWN = 0; const unsigned short LENGTHADJUST_SPACING = 1; const unsigned short LENGTHADJUST_SPACINGANDGLYPHS = 2; [SameObject] readonly attribute SVGAnimatedLength textLength; [SameObject] readonly attribute SVGAnimatedEnumeration lengthAdjust; long getNumberOfChars(); float getComputedTextLength(); float getSubStringLength(unsigned longcharnum, unsigned longnchars); SVGPoint getStartPositionOfChar(unsigned longcharnum); SVGPoint getEndPositionOfChar(unsigned longcharnum); SVGRect getExtentOfChar(unsigned longcharnum); float getRotationOfChar(unsigned longcharnum); long getCharNumAtPosition(optional DOMPointInitpoint= {}); undefined selectSubString(unsigned longcharnum, unsigned longnchars); }; [Exposed=Window] interfaceSVGTextPositioningElement: SVGTextContentElement { [SameObject] readonly attribute SVGAnimatedLengthList x; [SameObject] readonly attribute SVGAnimatedLengthList y; [SameObject] readonly attribute SVGAnimatedLengthList dx; [SameObject] readonly attribute SVGAnimatedLengthList dy; [SameObject] readonly attribute SVGAnimatedNumberList rotate; }; [Exposed=Window] interfaceSVGTextElement: SVGTextPositioningElement { }; [Exposed=Window] interfaceSVGTSpanElement: SVGTextPositioningElement { }; [Exposed=Window] interfaceSVGTextPathElement: SVGTextContentElement { // textPath Method Types const unsigned short TEXTPATH_METHODTYPE_UNKNOWN = 0; const unsigned short TEXTPATH_METHODTYPE_ALIGN = 1; const unsigned short TEXTPATH_METHODTYPE_STRETCH = 2; // textPath Spacing Types const unsigned short TEXTPATH_SPACINGTYPE_UNKNOWN = 0; const unsigned short TEXTPATH_SPACINGTYPE_AUTO = 1; const unsigned short TEXTPATH_SPACINGTYPE_EXACT = 2; // textPath Side Types const unsigned short TEXTPATH_SIDETYPE_UNKNOWN = 0; const unsigned short TEXTPATH_SIDETYPE_LEFT = 1; const unsigned short TEXTPATH_SIDETYPE_RIGHT = 2; [SameObject] readonly attribute SVGAnimatedLength startOffset; [SameObject] readonly attribute SVGAnimatedEnumeration method; [SameObject] readonly attribute SVGAnimatedEnumeration spacing; [SameObject] readonly attribute SVGAnimatedEnumeration side; }; SVGTextPathElement includes SVGURIReference; [Exposed=Window] interfaceSVGImageElement: SVGGraphicsElement { [SameObject] readonly attribute SVGAnimatedLength x; [SameObject] readonly attribute SVGAnimatedLength y; [SameObject] readonly attribute SVGAnimatedLength width; [SameObject] readonly attribute SVGAnimatedLength height; [SameObject] readonly attribute SVGAnimatedPreserveAspectRatio preserveAspectRatio; attribute DOMString? crossOrigin; attribute DOMString referrerPolicy; }; SVGImageElement includes SVGURIReference; [Exposed=Window] interfaceSVGForeignObjectElement: SVGGraphicsElement { [SameObject] readonly attribute SVGAnimatedLength x; [SameObject] readonly attribute SVGAnimatedLength y; [SameObject] readonly attribute SVGAnimatedLength width; [SameObject] readonly attribute SVGAnimatedLength height; }; [Exposed=Window] interfaceSVGMarkerElement: SVGElement { // Marker Unit Types const unsigned short SVG_MARKERUNITS_UNKNOWN = 0; const unsigned short SVG_MARKERUNITS_USERSPACEONUSE = 1; const unsigned short SVG_MARKERUNITS_STROKEWIDTH = 2; // Marker Orientation Types const unsigned short SVG_MARKER_ORIENT_UNKNOWN = 0; const unsigned short SVG_MARKER_ORIENT_AUTO = 1; const unsigned short SVG_MARKER_ORIENT_ANGLE = 2; const unsigned short SVG_MARKER_ORIENT_AUTO_START_REVERSE = 3; [SameObject] readonly attribute SVGAnimatedLength refX; [SameObject] readonly attribute SVGAnimatedLength refY; [SameObject] readonly attribute SVGAnimatedEnumeration markerUnits; [SameObject] readonly attribute SVGAnimatedLength markerWidth; [SameObject] readonly attribute SVGAnimatedLength markerHeight; [SameObject] readonly attribute SVGAnimatedEnumeration orientType; [SameObject] readonly attribute SVGAnimatedAngle orientAngle; attribute DOMString orient; undefined setOrientToAuto(); undefined setOrientToAngle(SVGAngleangle); }; SVGMarkerElement includes SVGFitToViewBox; [Exposed=Window] interfaceSVGGradientElement: SVGElement { // Spread Method Types const unsigned short SVG_SPREADMETHOD_UNKNOWN = 0; const unsigned short SVG_SPREADMETHOD_PAD = 1; const unsigned short SVG_SPREADMETHOD_REFLECT = 2; const unsigned short SVG_SPREADMETHOD_REPEAT = 3; [SameObject] readonly attribute SVGAnimatedEnumeration gradientUnits; [SameObject] readonly attribute SVGAnimatedTransformList gradientTransform; [SameObject] readonly attribute SVGAnimatedEnumeration spreadMethod; }; SVGGradientElement includes SVGURIReference; [Exposed=Window] interfaceSVGLinearGradientElement: SVGGradientElement { [SameObject] readonly attribute SVGAnimatedLength x1; [SameObject] readonly attribute SVGAnimatedLength y1; [SameObject] readonly attribute SVGAnimatedLength x2; [SameObject] readonly attribute SVGAnimatedLength y2; }; [Exposed=Window] interfaceSVGRadialGradientElement: SVGGradientElement { [SameObject] readonly attribute SVGAnimatedLength cx; [SameObject] readonly attribute SVGAnimatedLength cy; [SameObject] readonly attribute SVGAnimatedLength r; [SameObject] readonly attribute SVGAnimatedLength fx; [SameObject] readonly attribute SVGAnimatedLength fy; [SameObject] readonly attribute SVGAnimatedLength fr; }; [Exposed=Window] interfaceSVGStopElement: SVGElement { [SameObject] readonly attribute SVGAnimatedNumber offset; }; [Exposed=Window] interfaceSVGPatternElement: SVGElement { [SameObject] readonly attribute SVGAnimatedEnumeration patternUnits; [SameObject] readonly attribute SVGAnimatedEnumeration patternContentUnits; [SameObject] readonly attribute SVGAnimatedTransformList patternTransform; [SameObject] readonly attribute SVGAnimatedLength x; [SameObject] readonly attribute SVGAnimatedLength y; [SameObject] readonly attribute SVGAnimatedLength width; [SameObject] readonly attribute SVGAnimatedLength height; }; SVGPatternElement includes SVGFitToViewBox; SVGPatternElement includes SVGURIReference; [Exposed=Window] interfaceSVGScriptElement: SVGElement { [Reflect] attribute DOMStringtype; attribute DOMString? crossOrigin; attribute DOMString referrerPolicy; }; SVGScriptElement includes SVGURIReference; [Exposed=Window] interfaceSVGAElement: SVGGraphicsElement { [Reflect, SameObject] readonly attribute SVGAnimatedStringtarget; [Reflect] attribute DOMStringdownload; [Reflect] attribute USVStringping; [Reflect] attribute DOMStringrel; [Reflect="rel", SameObject, PutForwards=value] readonly attribute DOMTokenListrelList; [Reflect] attribute DOMStringhreflang; [Reflect] attribute DOMStringtype; attribute DOMString referrerPolicy; }; SVGAElement includes SVGURIReference; SVGAElement includes HyperlinkElementUtils; [Exposed=Window] interfaceSVGViewElement: SVGElement {}; SVGViewElement includes SVGFitToViewBox;