SVG string list interface
The SVGStringList
defines a list of {{ domxref("DOMString") }} objects.
An SVGStringList
object can be designated as read only, which means that attempts to modify the object will result in an exception being thrown.
Interface overview
Also implement | None |
---|---|
Methods |
|
Properties |
|
Normative document | SVG 1.1 (2nd Edition) |
Properties
Name | Type | Description |
---|---|---|
numberOfItems | unsigned long | The number of items in the list. |
length | unsigned long | A mirror of the value in numberOfItems , for consistency with other interfaces. {{ non-standard_inline() }} |
Methods
Name & Arguments | Return | Description |
---|---|---|
clear() | void | Clears all existing current items from the list, with the result being an empty list. Exceptions:
|
initialize(in {{ domxref("DOMString") }} newItem) | {{ domxref("DOMString") }} | Clears all existing current items from the list and re-initializes the list to hold the single item specified by the parameter. If the inserted item is already in a list, it is removed from its previous list before it is inserted into this list. The inserted item is the item itself and not a copy. The return value is the item inserted into the list. Exceptions:
|
getItem(in unsigned long index) | {{ domxref("DOMString") }} | Returns the specified item from the list. The returned item is the item itself and not a copy. Any changes made to the item are immediately reflected in the list. The first item is number 0. Exceptions:
|
insertItemBefore(in {{ domxref("DOMString") }} newItem, in unsigned long index) | {{ domxref("DOMString") }} | Inserts a new item into the list at the specified position. The first item is number 0. If Exceptions:
|
replaceItem(in {{ domxref("DOMString") }} newItem, in unsigned long index) | {{ domxref("DOMString") }} | Replaces an existing item in the list with a new item. If Exceptions:
|
removeItem(in unsigned long index) | {{ domxref("DOMString") }} | Removes an existing item from the list. Exceptions:
|
appendItem(in {{ domxref("DOMString") }} newItem) | {{ domxref("DOMString") }} | Inserts a new item at the end of the list. If Exceptions:
|
Browser compatibility
{{ CompatibilityTable() }}
Feature | Chrome | Firefox (Gecko) | Internet Explorer | Opera | Safari (WebKit) |
---|---|---|---|---|---|
Basic support | {{ CompatUnknown() }} | {{ CompatGeckoDesktop("12") }} | 9.0 | {{ CompatUnknown() }} | {{ CompatUnknown() }} |
length property {{ non-standard_inline() }} | {{ CompatUnknown() }} | {{ CompatGeckoDesktop("12") }} | {{ CompatUnknown() }} | {{ CompatUnknown() }} | {{ CompatUnknown() }} |
Feature | Android | Firefox Mobile (Gecko) | IE Mobile | Opera Mobile | Safari Mobile |
---|---|---|---|---|---|
Basic support | {{ CompatUnknown() }} | {{ CompatGeckoMobile("12") }} | {{ CompatUnknown() }} | {{ CompatUnknown() }} | {{ CompatUnknown() }} |
length property {{ non-standard_inline() }} | {{ CompatUnknown() }} | {{ CompatGeckoMobile("12") }} | {{ CompatUnknown() }} | {{ CompatUnknown() }} | {{ CompatUnknown() }} |
Gecko notes
Since Firefox 13, SVGStringList
is indexable like Array which is a non-standard behavior.