The common data types for SVG's properties and attributes fall into the following categories:
ListOfXXX:
XXX
| XXX comma-wsp ListOfXXX
comma-wsp:
(wsp+ comma? wsp*) | (comma wsp*)
comma:
","
wsp:
(#x20 | #x9 | #xD | #xA)
where XXX represents a particular type of value.The following is the list of recognized color keywords that can be used as a keyword value for data type <color>:
|
|
The following interfaces are defined below: SVGElement, SVGAnimatedBoolean, SVGAnimatedString, SVGStringList, SVGAnimatedEnumeration, SVGAnimatedInteger, SVGNumber, SVGAnimatedNumber, SVGNumberList, SVGAnimatedNumberList, SVGLength, SVGAnimatedLength, SVGLengthList, SVGAnimatedLengthList, SVGAngle, SVGAnimatedAngle, SVGColor, SVGICCColor, SVGRect, SVGAnimatedRect, SVGUnitTypes, SVGStylable, SVGLocatable, SVGTransformable, SVGTests, SVGLangSpace, SVGExternalResourcesRequired, SVGFitToViewBox, SVGZoomAndPan, SVGViewSpec, SVGURIReference, SVGCSSRule, SVGRenderingIntent.
All of the SVG DOM interfaces that correspond directly to elements in the SVG language (e.g., the SVGPathElement interface corresponds directly to the 'path' element in the language) are derivative from base class SVGElement.
interface SVGElement : Element {
attribute DOMString id;
// raises DOMException on setting
attribute DOMString xmlbase;
// raises DOMException on setting
readonly attribute SVGSVGElement ownerSVGElement;
readonly attribute SVGElement viewportElement;
};
| DOMException |
NO_MODIFICATION_ALLOWED_ERR: Raised on an
attempt to change the value of a readonly
attribute.
|
| DOMException |
NO_MODIFICATION_ALLOWED_ERR: Raised on an
attempt to change the value of a readonly
attribute.
|
interface SVGAnimatedBoolean {
attribute boolean baseVal;
// raises DOMException on setting
readonly attribute boolean animVal;
};
| DOMException |
NO_MODIFICATION_ALLOWED_ERR: Raised on an
attempt to change the value of a readonly
attribute.
|
interface SVGAnimatedString {
attribute DOMString baseVal;
// raises DOMException on setting
readonly attribute DOMString animVal;
};
| DOMException |
NO_MODIFICATION_ALLOWED_ERR: Raised on an
attempt to change the value of a readonly
attribute.
|
This interface defines a list of DOMString objects.
SVGStringList has the same attributes and methods as other SVGxxxList interfaces. Implementers may consider using a single base class to implement the various SVGxxxList interfaces.
interface SVGStringList {
readonly attribute unsigned long numberOfItems;
void clear ( )
raises( DOMException );
DOMString initialize ( in DOMString newItem )
raises( DOMException, SVGException );
DOMString getItem ( in unsigned long index )
raises( DOMException );
DOMString insertItemBefore ( in DOMString newItem, in unsigned long index )
raises( DOMException, SVGException );
DOMString replaceItem ( in DOMString newItem, in unsigned long index )
raises( DOMException, SVGException );
DOMString removeItem ( in unsigned long index )
raises( DOMException );
DOMString appendItem ( in DOMString newItem )
raises( DOMException, SVGException );
};
| DOMException |
NO_MODIFICATION_ALLOWED_ERR: Raised when
the list cannot be modified.
|
| in DOMString newItem | The item which should become the only member of the list. |
| DOMString | The item being inserted into the list. |
| DOMException |
NO_MODIFICATION_ALLOWED_ERR: Raised when
the list cannot be modified.
|
|
| SVGException |
SVG_WRONG_TYPE_ERR: Raised if parameter
newItem is the wrong type of object for the
given list.
|
| in unsigned long index | The index of the item from the list which is to be returned. The first item is number 0. |
| DOMString | The selected item. |
| DOMException |
INDEX_SIZE_ERR: Raised if the index number
is negative or greater than or equal to
numberOfItems.
|
| in DOMString newItem | The item which is to be inserted into the list. | |
| in unsigned long index | The index of the item before which the new
item is to be inserted. The first item is
number 0. If the index is equal to 0, then the new item is inserted at the front of the list. If the index is greater than or equal to numberOfItems, then the new item is appended to the end of the list. |
| DOMString | The inserted item. |
| DOMException |
NO_MODIFICATION_ALLOWED_ERR: Raised when
the list cannot be modified.
|
|
| SVGException |
SVG_WRONG_TYPE_ERR: Raised if parameter
newItem is the wrong type of object for the
given list.
|
| in DOMString newItem | The item which is to be inserted into the list. | |
| in unsigned long index | The index of the item which is to be replaced. The first item is number 0. |
| DOMString | The inserted item. |
| DOMException |
NO_MODIFICATION_ALLOWED_ERR: Raised when
the list cannot be modified.
INDEX_SIZE_ERR: Raised if the index number
is negative or greater than or equal to
numberOfItems.
|
|
| SVGException |
SVG_WRONG_TYPE_ERR: Raised if parameter
newItem is the wrong type of object for the
given list.
|
| in unsigned long index | The index of the item which is to be removed. The first item is number 0. |
| DOMString | The removed item. |
| DOMException |
NO_MODIFICATION_ALLOWED_ERR: Raised when
the list cannot be modified.
INDEX_SIZE_ERR: Raised if the index number
is negative or greater than or equal to
numberOfItems.
|
| in DOMString newItem | The item which is to be inserted into the list. The first item is number 0. |
| DOMString | The inserted item. |
| DOMException |
NO_MODIFICATION_ALLOWED_ERR: Raised when
the list cannot be modified.
|
|
| SVGException |
SVG_WRONG_TYPE_ERR: Raised if parameter
newItem is the wrong type of object for the
given list.
|
interface SVGAnimatedEnumeration {
attribute unsigned short baseVal;
// raises DOMException on setting
readonly attribute unsigned short animVal;
};
| DOMException |
NO_MODIFICATION_ALLOWED_ERR: Raised on an
attempt to change the value of a readonly
attribute.
|
interface SVGAnimatedInteger {
attribute long baseVal;
// raises DOMException on setting
readonly attribute long animVal;
};
| DOMException |
NO_MODIFICATION_ALLOWED_ERR: Raised on an
attempt to change the value of a readonly
attribute.
|
interface SVGNumber {
attribute float value;
// raises DOMException on setting
};
| DOMException |
NO_MODIFICATION_ALLOWED_ERR: Raised on an
attempt to change the value of a readonly
attribute.
|
interface SVGAnimatedNumber {
attribute float baseVal;
// raises DOMException on setting
readonly attribute float animVal;
};
| DOMException |
NO_MODIFICATION_ALLOWED_ERR: Raised on an
attempt to change the value of a readonly
attribute.
|
This interface defines a list of SVGNumber objects.
SVGNumberList has the same attributes and methods as other SVGxxxList interfaces. Implementers may consider using a single base class to implement the various SVGxxxList interfaces.
interface SVGNumberList {
readonly attribute unsigned long numberOfItems;
void clear ( )
raises( DOMException );
SVGNumber initialize ( in SVGNumber newItem )
raises( DOMException, SVGException );
SVGNumber getItem ( in unsigned long index )
raises( DOMException );
SVGNumber insertItemBefore ( in SVGNumber newItem, in unsigned long index )
raises( DOMException, SVGException );
SVGNumber replaceItem ( in SVGNumber newItem, in unsigned long index )
raises( DOMException, SVGException );
SVGNumber removeItem ( in unsigned long index )
raises( DOMException );
SVGNumber appendItem ( in SVGNumber newItem )
raises( DOMException, SVGException );
};
| DOMException |
NO_MODIFICATION_ALLOWED_ERR: Raised when
the list cannot be modified.
|
| in SVGNumber newItem | The item which should become the only member of the list. |
| SVGNumber | The item being inserted into the list. |
| DOMException |
NO_MODIFICATION_ALLOWED_ERR: Raised when
the list cannot be modified.
|
|
| SVGException |
SVG_WRONG_TYPE_ERR: Raised if parameter
newItem is the wrong type of object for the
given list.
|
| in unsigned long index | The index of the item from the list which is to be returned. The first item is number 0. |
| SVGNumber | The selected item. |
| DOMException |
INDEX_SIZE_ERR: Raised if the index number
is negative or greater than or equal to
numberOfItems.
|
| in SVGNumber newItem | The item which is to be inserted into the list. | |
| in unsigned long index | The index of the item before which the new
item is to be inserted. The first item is
number 0. If the index is equal to 0, then the new item is inserted at the front of the list. If the index is greater than or equal to numberOfItems, then the new item is appended to the end of the list. |
| SVGNumber | The inserted item. |
| DOMException |
NO_MODIFICATION_ALLOWED_ERR: Raised when
the list cannot be modified.
|
|
| SVGException |
SVG_WRONG_TYPE_ERR: Raised if parameter
newItem is the wrong type of object for the
given list.
|
| in SVGNumber newItem | The item which is to be inserted into the list. | |
| in unsigned long index | The index of the item which is to be replaced. The first item is number 0. |
| SVGNumber | The inserted item. |
| DOMException |
NO_MODIFICATION_ALLOWED_ERR: Raised when
the list cannot be modified.
INDEX_SIZE_ERR: Raised if the index number
is negative or greater than or equal to
numberOfItems.
|
|
| SVGException |
SVG_WRONG_TYPE_ERR: Raised if parameter
newItem is the wrong type of object for the
given list.
|
| in unsigned long index | The index of the item which is to be removed. The first item is number 0. |
| SVGNumber | The removed item. |
| DOMException |
NO_MODIFICATION_ALLOWED_ERR: Raised when
the list cannot be modified.
INDEX_SIZE_ERR: Raised if the index number
is negative or greater than or equal to
numberOfItems.
|
| in SVGNumber newItem | The item which is to be inserted into the list. The first item is number |