EN
Ce contenu n’est pas disponible dans votre langue. Voici la version anglaise.

SVGElementInstance object

Represents a single node in the instance tree (or shadow tree) that the SVG DOM maintains.

Scalable Vector Graphics: Document Structure, Section 5.11.9Internet Explorer 9

Members

The SVGElementInstance object has these types of members:

Methods

The SVGElementInstance object has these methods.

MethodDescription
addEventListener

Registers an event handler for the specified event type.

addEventListener

Registers an event listener

dispatchEvent

Sends an event to the current element.

dispatchEvent

Dispatches an event to an object.

removeEventListener

Removes an event handler that the addEventListener method registered.

removeEventListener

Removes an event listener.

 

Properties

The SVGElementInstance object has these properties.

PropertyDescription

childNodes

Gets an SVGElementInstanceList object that contains all children of this SVGElementInstance object within the instance tree.

correspondingElement

Gets the corresponding element that this object is an instance of.

correspondingUseElement

Gets the corresponding use element that this object belongs to.

firstChild

Gets the first child of this SVGElementInstance object in the instance tree.

lastChild

Gets the last child of this SVGElementInstance object in the instance tree.

nextSibling

Gets the SVGElementInstance object that immediately follows this SVGElementInstance object.

parentNode

Gets the parent of this SVGElementInstance object within the instance tree.

previousSibling

Gets the SVGElementInstance object that immediately precedes this SVGElementInstance object.

 

Standards information

Remarks

Note  In addition to the attributes, properties, events, methods, and styles listed above, SVG elements also inherit core HTML attributes, properties, events, methods, and styles.

The root object in the instance tree is pointed to by the instanceRoot attribute on the SVGUseElement object for the corresponding use element.

If the use element references a simple graphics element such as rect, there is only one SVGElementInstance object, and the correspondingElement attribute on this SVGElementInstance object is the SVGRectElement that corresponds to the referenced rect element.

If the use element references a g element that contains two rect elements, the instance tree contains three SVGElementInstance objects: a root SVGElementInstance object whose correspondingElement attribute is the SVGGElement object for the g element, and then two child SVGElementInstance objects that have their correspondingElement attribute that is an SVGRectElement object.

If the referenced object is a use element, or if there are use subelements within the referenced object, the instance tree contains a recursive expansion of the indirect references to form a complete tree. For example, if a use element references a g element, and the g element contains a use element, and that use element references a rect element, the instance tree for the original (outermost) use consists of a hierarchy of SVGElementInstance objects, as follows:


SVGElementInstance #1 (parentNode=null, firstChild=#2, correspondingElement is the 'g')
  SVGElementInstance #2 (parentNode=#1, firstChild=#3, correspondingElement is the other 'use')
    SVGElementInstance #3 (parentNode=#2, firstChild=null, correspondingElement is the 'rect')

 

 

Afficher:
© 2014 Microsoft