SVGElement class Null safety

All of the SVG DOM interfaces that correspond directly to elements in the SVG language derive from the interface.

Inheritance
Mixed in types
Implementers
Annotations

Constructors

SVGElement()
factory

Properties

ariaAtomic String
read / write, inherited
ariaAutoComplete String
read / write, inherited
ariaBusy String
read / write, inherited
ariaChecked String
read / write, inherited
ariaColCount String
read / write, inherited
ariaColIndex String
read / write, inherited
ariaColIndexText String
read / write, inherited
ariaColSpan String
read / write, inherited
ariaCurrent String
read / write, inherited
ariaDescription String
read / write, inherited
ariaDisabled String
read / write, inherited
ariaExpanded String
read / write, inherited
ariaHasPopup String
read / write, inherited
ariaHidden String
read / write, inherited
ariaInvalid String
read / write, inherited
ariaKeyShortcuts String
read / write, inherited
ariaLabel String
read / write, inherited
ariaLevel String
read / write, inherited
ariaLive String
read / write, inherited
ariaModal String
read / write, inherited
ariaMultiLine String
read / write, inherited
ariaMultiSelectable String
read / write, inherited
ariaOrientation String
read / write, inherited
ariaPlaceholder String
read / write, inherited
ariaPosInSet String
read / write, inherited
ariaPressed String
read / write, inherited
ariaReadOnly String
read / write, inherited
ariaRequired String
read / write, inherited
ariaRoleDescription String
read / write, inherited
ariaRowCount String
read / write, inherited
ariaRowIndex String
read / write, inherited
ariaRowIndexText String
read / write, inherited
ariaRowSpan String
read / write, inherited
ariaSelected String
read / write, inherited
ariaSetSize String
read / write, inherited
ariaSort String
read / write, inherited
ariaValueMax String
read / write, inherited
ariaValueMin String
read / write, inherited
ariaValueNow String
read / write, inherited
ariaValueText String
read / write, inherited
assignedSlot HTMLSlotElement?
read-only, inherited
attributes NamedNodeMap
Returns a NamedNodeMap object containing the assigned attributes of the corresponding HTML element.
read-only, inherited
attributeStyleMap StylePropertyMap
read-only, inherited
autofocus bool
read / write, inherited
baseURI String
Returns a DOMString representing the base URL of the document containing the Node.
read-only, inherited
childElementCount int
read-only, inherited
childNodes NodeList
Returns a live NodeList containing all the children of this node (including elements, text and comments). NodeList being live means that if the children of the Node change, the NodeList object is automatically updated.
read-only, inherited
children HTMLCollection
read-only, inherited
classList DOMTokenList
Returns a DOMTokenList containing the list of class attributes.
read-only, inherited
className SVGAnimatedString
An SVGAnimatedString that reflects the value of the class attribute on the given element, or the empty string if class is not present. This attribute is deprecated and may be removed in a future version of this specification. Authors are advised to use Element.classList instead.
covariant, read / write, inherited-setter, override-getter
clientHeight int
read-only, inherited
clientLeft int
read-only, inherited
clientTop int
read-only, inherited
clientWidth int
read-only, inherited
correspondingElement SVGElement?
read-only, inherited
correspondingUseElement SVGUseElement?
read-only, inherited
dataset DOMStringMap
read-only, inherited
elementTiming String
read / write, inherited
firstChild Node?
Returns a Node representing the first direct child node of the node, or null if the node has no child.
read-only, inherited
firstElementChild Element?
read-only, inherited
hashCode int
The hash code for this object. [...]
read-only, inherited
id String
Is a DOMString representing the id of the element.
read / write, inherited
innerHTML String
read / write, inherited
isConnected bool
A boolean indicating whether or not the Node is connected (directly or indirectly) to the context object, e.g. the Document object in the case of the normal DOM, or the ShadowRoot in the case of a shadow DOM.
read-only, inherited
lastChild Node?
Returns a Node representing the last direct child node of the node, or null if the node has no child.
read-only, inherited
lastElementChild Element?
read-only, inherited
localName String
A DOMString representing the local part of the qualified name of the element.
read-only, inherited
mPart DOMTokenList
@JS('part'), read-only, inherited
namespaceURI String?
The namespace URI of the element, or null if it is no namespace. [...]
read-only, inherited
nextElementSibling Element?
read-only, inherited
nextSibling Node?
Returns a Node representing the next node in the tree, or null if there isn't such node.
read-only, inherited
nodeName String
Returns a DOMString containing the name of the Node. The structure of the name will differ with the node type. E.g. An HTMLElement will contain the name of the corresponding tag, like 'audio' for an HTMLAudioElement, a Text node will have the '#text' string, or a Document node will have the '#document' string.
read-only, inherited
nodeType int
Returns an unsigned short representing the type of the node. Possible values are: [...]
read-only, inherited
nodeValue String?
Returns / Sets the value of the current node.
read / write, inherited
nonce String
read / write, inherited
onabort EventHandlerNonNull?
read / write, inherited
onanimationcancel EventHandlerNonNull?
read / write, inherited
onanimationend EventHandlerNonNull?
read / write, inherited
onanimationiteration EventHandlerNonNull?
read / write, inherited
onanimationstart EventHandlerNonNull?
read / write, inherited
onauxclick EventHandlerNonNull?
read / write, inherited
onbeforexrselect EventHandlerNonNull?
read / write, inherited
onblur EventHandlerNonNull?
read / write, inherited
oncancel EventHandlerNonNull?
read / write, inherited
oncanplay EventHandlerNonNull?
read / write, inherited
oncanplaythrough EventHandlerNonNull?
read / write, inherited
onchange EventHandlerNonNull?
read / write, inherited
onclick EventHandlerNonNull?
read / write, inherited
onclose EventHandlerNonNull?
read / write, inherited
oncontextmenu EventHandlerNonNull?
read / write, inherited
oncopy EventHandlerNonNull?
read / write, inherited
oncuechange EventHandlerNonNull?
read / write, inherited
oncut EventHandlerNonNull?
read / write, inherited
ondblclick EventHandlerNonNull?
read / write, inherited
ondrag EventHandlerNonNull?
read / write, inherited
ondragend EventHandlerNonNull?
read / write, inherited
ondragenter EventHandlerNonNull?
read / write, inherited
ondragleave EventHandlerNonNull?
read / write, inherited
ondragover EventHandlerNonNull?
read / write, inherited
ondragstart EventHandlerNonNull?
read / write, inherited
ondrop EventHandlerNonNull?
read / write, inherited
ondurationchange EventHandlerNonNull?
read / write, inherited
onemptied EventHandlerNonNull?
read / write, inherited
onended EventHandlerNonNull?
read / write, inherited
onerror OnErrorEventHandlerNonNull?
read / write, inherited
onfocus EventHandlerNonNull?
read / write, inherited
onformdata EventHandlerNonNull?
read / write, inherited
onfullscreenchange EventHandlerNonNull?
read / write, inherited
onfullscreenerror EventHandlerNonNull?
read / write, inherited
ongotpointercapture EventHandlerNonNull?
read / write, inherited
oninput EventHandlerNonNull?
read / write, inherited
oninvalid EventHandlerNonNull?
read / write, inherited
onkeydown EventHandlerNonNull?
read / write, inherited
onkeypress EventHandlerNonNull?
read / write, inherited
onkeyup EventHandlerNonNull?
read / write, inherited
onload EventHandlerNonNull?
read / write, inherited
onloadeddata EventHandlerNonNull?
read / write, inherited
onloadedmetadata EventHandlerNonNull?
read / write, inherited
onloadstart EventHandlerNonNull?
read / write, inherited
onlostpointercapture EventHandlerNonNull?
read / write, inherited
onmousedown EventHandlerNonNull?
read / write, inherited
onmouseenter EventHandlerNonNull?
read / write, inherited
onmouseleave EventHandlerNonNull?
read / write, inherited
onmousemove EventHandlerNonNull?
read / write, inherited
onmouseout EventHandlerNonNull?
read / write, inherited
onmouseover EventHandlerNonNull?
read / write, inherited
onmouseup EventHandlerNonNull?
read / write, inherited
onpaste EventHandlerNonNull?
read / write, inherited
onpause EventHandlerNonNull?
read / write, inherited
onplay EventHandlerNonNull?
read / write, inherited
onplaying EventHandlerNonNull?
read / write, inherited
onpointercancel EventHandlerNonNull?
read / write, inherited
onpointerdown EventHandlerNonNull?
read / write, inherited
onpointerenter EventHandlerNonNull?
read / write, inherited
onpointerleave EventHandlerNonNull?
read / write, inherited
onpointermove EventHandlerNonNull?
read / write, inherited
onpointerout EventHandlerNonNull?
read / write, inherited
onpointerover EventHandlerNonNull?
read / write, inherited
onpointerrawupdate EventHandlerNonNull?
read / write, inherited
onpointerup EventHandlerNonNull?
read / write, inherited
onprogress EventHandlerNonNull?
read / write, inherited
onratechange EventHandlerNonNull?
read / write, inherited
onreset EventHandlerNonNull?
read / write, inherited
onresize EventHandlerNonNull?
read / write, inherited
onscroll EventHandlerNonNull?
read / write, inherited
onsecuritypolicyviolation EventHandlerNonNull?
read / write, inherited
onseeked EventHandlerNonNull?
read / write, inherited
onseeking EventHandlerNonNull?
read / write, inherited
onselect EventHandlerNonNull?
read / write, inherited
onselectionchange EventHandlerNonNull?
read / write, inherited
onselectstart EventHandlerNonNull?
read / write, inherited
onslotchange EventHandlerNonNull?
read / write, inherited
onstalled EventHandlerNonNull?
read / write, inherited
onsubmit EventHandlerNonNull?
read / write, inherited
onsuspend EventHandlerNonNull?
read / write, inherited
ontimeupdate EventHandlerNonNull?
read / write, inherited
ontoggle EventHandlerNonNull?
read / write, inherited
ontouchcancel EventHandlerNonNull?
read / write, inherited
ontouchend EventHandlerNonNull?
read / write, inherited
ontouchmove EventHandlerNonNull?
read / write, inherited
ontouchstart EventHandlerNonNull?
read / write, inherited
ontransitioncancel EventHandlerNonNull?
read / write, inherited
ontransitionend EventHandlerNonNull?
read / write, inherited
ontransitionrun EventHandlerNonNull?
read / write, inherited
ontransitionstart EventHandlerNonNull?
read / write, inherited
onvolumechange EventHandlerNonNull?
read / write, inherited
onwaiting EventHandlerNonNull?
read / write, inherited
onwebkitanimationend EventHandlerNonNull?
read / write, inherited
onwebkitanimationiteration EventHandlerNonNull?
read / write, inherited
onwebkitanimationstart EventHandlerNonNull?
read / write, inherited
onwebkittransitionend EventHandlerNonNull?
read / write, inherited
onwheel EventHandlerNonNull?
read / write, inherited
outerHTML String
read / write, inherited
ownerDocument Document?
Returns the Document that this node belongs to. If the node is itself a document, returns null.
read-only, inherited
ownerSVGElement SVGSVGElement?
An SVGSVGElement referring to the nearest ancestor <svg> element. null if the given element is the outermost <svg> element.
read-only
parentElement Element?
Returns an Element that is the parent of this node. If the node has no parent, or if that parent is not an Element, this property returns null.
read-only, inherited
parentNode Node?
Returns a Node that is the parent of this node. If there is no such node, like if this node is the top of the tree or if doesn't participate in a tree, this property returns null.
read-only, inherited
prefix String?
A DOMString representing the namespace prefix of the element, or null if no prefix is specified.
read-only, inherited
previousElementSibling Element?
read-only, inherited
previousSibling Node?
Returns a Node representing the previous node in the tree, or null if there isn't such node.
read-only, inherited
regionOverset String
read-only, inherited
role String?
read / write, inherited
runtimeType Type
A representation of the runtime type of the object.
read-only, inherited
scrollHeight int
read-only, inherited
scrollLeft ↔ dynamic
read / write, inherited
scrollTop ↔ dynamic
read / write, inherited
scrollWidth int
read-only, inherited
shadowRoot ShadowRoot?
Returns the open shadow root that is hosted by the element, or null if no open shadow root is present.
read-only, inherited
slot String
Returns the name of the shadow DOM slot the element is inserted in.
@experimental, read / write, inherited
style CSSStyleDeclaration
read-only, inherited
tabIndex int
read / write, inherited
tagName String
Returns a String with the name of the tag for the given element.
read-only, inherited
textContent String?
Returns / Sets the textual content of an element and all its descendants.
read / write, inherited
viewportElement SVGElement?
The SVGElement, which established the current viewport. Often, the nearest ancestor <svg> element. null if the given element is the outermost <svg> element.
read-only

Methods

addEventListener(String type, EventListener? callback, [dynamic options]) Object
Registers an event handler of a specific event type on the EventTarget. target.addEventListener(type, listener); target.addEventListener(type, listener, options); target.addEventListener(type, listener, useCapture); target.addEventListener(type, listener, useCapture, wantsUntrusted); // wantsUntrusted is Firefox only
inherited
after([dynamic nodes]) Object
Inserts a set of Node or DOMString objects in the children list of this ChildNode's parent, just after this ChildNode. DOMString objects are inserted as equivalent Text nodes. Throws, Unscopable void ChildNode.after((Node or DOMString)... nodes);
@experimental, inherited
animate(dynamic keyframes, [dynamic options]) Animation
inherited
append([dynamic nodes]) Object
inherited
appendChild(Node node) Node
inherited
attachShadow(ShadowRootInit init) ShadowRoot
Attaches a shadow DOM tree to the specified element and returns a reference to its ShadowRoot. var shadowroot = element.attachShadow(shadowRootInit);
inherited
before([dynamic nodes]) Object
Inserts a set of Node or DOMString objects in the children list of this ChildNode's parent, just before this ChildNode. DOMString objects are inserted as equivalent Text nodes. Throws, Unscopable void ChildNode.before((Node or DOMString)... nodes);
@experimental, inherited
blur() Object
inherited
cloneNode([bool? deep = false]) Node
Clone a Node, and optionally, all of its contents. By default, it clones the content of the node. let newClone = node.cloneNode(deep) [...]
inherited
closest(String selectors) Element?
Returns the Element which is the closest ancestor of the current element (or the current element itself) which matches the selectors given in parameter. var closestElement = targetElement.closest(selectors);
inherited
compareDocumentPosition(Node other) int
Compares the position of the current node against another node in any other document. compareMask = node.compareDocumentPosition(otherNode) [...]
inherited
computedStyleMap() StylePropertyMapReadOnly
inherited
contains(Node? other) bool
Returns a Boolean value indicating whether or not a node is a descendant of the calling node. node.contains( otherNode ) [...]
inherited
convertPointFromNode(DOMPointInit point, dynamic from, [ConvertCoordinateOptions? options]) DOMPoint
inherited
convertQuadFromNode(DOMQuadInit quad, dynamic from, [ConvertCoordinateOptions? options]) DOMQuad
inherited
convertRectFromNode(DOMRectReadOnly rect, dynamic from, [ConvertCoordinateOptions? options]) DOMQuad
inherited
dispatchEvent(Event event) bool
Dispatches an event to this EventTarget. cancelled = !target.dispatchEvent(event) [...]
inherited
focus([FocusOptions? options]) Object
inherited
focusableAreas([FocusableAreasOption? option]) Iterable<Node>
inherited
getAnimations([GetAnimationsOptions? options]) Iterable<Animation>
inherited
getAttribute(String qualifiedName) String?
Retrieves the value of the named attribute from the current node and returns it as an Object. let attribute = element.getAttribute(attributeName); where attribute is a string containing the value of attributeName. attributeName is the name of the attribute whose value you want to get.
inherited
getAttributeNames() Iterable<String>
Returns an array of attribute names from the current element. let attributeNames = element.getAttributeNames(); [...]
inherited
getAttributeNode(String qualifiedName) Attr?
Retrieves the node representation of the named attribute from the current node and returns it as an Attr. var attrNode = element.getAttributeNode(attrName); [...]
inherited
getAttributeNodeNS(String? namespace, String localName) Attr?
Retrieves the node representation of the attribute with the specified name and namespace, from the current node and returns it as an Attr. attributeNode = element.getAttributeNodeNS(namespace, nodeName) [...]
inherited
getAttributeNS(String? namespace, String localName) String?
Retrieves the value of the attribute with the specified name and namespace, from the current node and returns it as an Object. attrVal = element.getAttributeNS(namespace, name)
inherited
getBoundingClientRect() DOMRect
inherited
getBoxQuads([BoxQuadOptions? options]) Iterable<DOMQuad>
inherited
getClientRects() DOMRectList
inherited
getElementsByClassName(String classNames) HTMLCollection
Returns a live HTMLCollection that contains all descendants of the current element that possess the list of classes given in the parameter. var elements = element.getElementsByClassName(names);
inherited
getElementsByTagName(String qualifiedName) HTMLCollection
Returns a live HTMLCollection containing all descendant elements, of a particular tag name, from the current element. elements = element.getElementsByTagName(tagName) elements is a live HTMLCollection of elements with a matching tag name, in the order they appear. If no elements are found, the HTMLCollection is empty. element is the element from where the search starts. Only the element's descendants are included, not the element itself. tagName is the qualified name to look for. The special string "*" represents all elements. For compatibility with XHTML, lower-case should be used. [...]
inherited
getElementsByTagNameNS(String? namespace, String localName) HTMLCollection
Returns a live HTMLCollection containing all descendant elements, of a particular tag name and namespace, from the current element. elements = element.getElementsByTagNameNS(namespaceURI, localName) elements is a live HTMLCollection of found elements in the order they appear in the tree. element is the element from where the search should start. Note that only the descendants of this element are included in the search, not the node itself. [...]
inherited
getRegionFlowRanges() Iterable<Range>
inherited
getRootNode([GetRootNodeOptions? options]) Node
Returns the context object's root which optionally includes the shadow root if it is available. var root = node.getRootNode(options);
inherited
getSpatialNavigationContainer() Node
inherited
hasAttribute(String qualifiedName) bool
Returns a Boolean indicating if the element has the specified attribute or not. var result = element.hasAttribute(name); [...]
inherited
hasAttributeNS(String? namespace, String localName) bool
Returns a Boolean indicating if the element has the specified attribute, in the specified namespace, or not. result = element.hasAttributeNS(namespace,localName) [...]
inherited
hasAttributes() bool
Returns a Boolean indicating if the element has one or more HTML attributes present. var result = element.hasAttributes();
inherited
hasChildNodes() bool
Returns a Boolean indicating whether or not the element has any child nodes. bool = node.hasChildNodes(); let foo = document.getElementById('foo'); [...]
inherited
hasPointerCapture(int pointerId) bool
inherited
insertAdjacentElement(String where, Element element) Element?
Inserts a given element node at a given position relative to the element it is invoked upon. targetElement.insertAdjacentElement(position, element); beforeBtn.addEventListener('click', function() { var tempDiv = document.createElement('div'); tempDiv.style.backgroundColor = randomColor(); if (activeElem) { activeElem.insertAdjacentElement('beforebegin', tempDiv); } setListener(tempDiv); }); [...]
inherited
insertAdjacentHTML(String position, String text) Object
inherited
insertAdjacentText(String where, String data) Object
Inserts a given text node at a given position relative to the element it is invoked upon. element.insertAdjacentText(position, element); beforeBtn.addEventListener('click', function() { para.insertAdjacentText('afterbegin',textInput.value); }); [...]
inherited
insertBefore(Node node, Node? child) Node
Inserts a Node before the reference node as a child of a specified parent node. let insertedNode = parentNode.insertBefore(newNode, referenceNode) [...]
inherited
isDefaultNamespace(String? namespace) bool
Accepts a namespace URI as an argument and returns a Boolean with a value of true if the namespace is the default namespace on the given node or false if not. result = node.isDefaultNamespace(namespaceURI); var XULNS = "http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"; var el = document.getElementsByTagNameNS(XULNS, 'textbox')0; [...]
inherited
isEqualNode(Node? otherNode) bool
Returns a Boolean which indicates whether or not two nodes are of the same type and all their defining data points match. var isEqualNode = node.isEqualNode(otherNode); [...]
inherited
isSameNode(Node? otherNode) bool
Returns a Boolean value indicating whether or not the two nodes are the same (that is, they reference the same object). const isSameNode = node.isSameNode(otherNode) [...]
inherited
lookupNamespaceURI(String? prefix) String?
Accepts a prefix and returns the namespace URI associated with it on the given node if found (and null if not). Supplying null for the prefix will return the default namespace. var namespace = node.lookupNamespaceURI(prefix);
inherited
lookupPrefix(String? namespace) String?
Returns a DOMString containing the prefix for a given namespace URI, if present, and null if not. When multiple prefixes are possible, the result is implementation-dependent.
inherited
matches(String selectors) bool
Returns a Boolean indicating whether or not the element would be selected by the specified selector string. var result = element.matches(selectorString); [...]
inherited
normalize() Object
Clean up all the text nodes under this element (merge adjacent, remove empty). element.normalize(); [...]
inherited
noSuchMethod(Invocation invocation) → dynamic
Invoked when a non-existent method or property is accessed. [...]
inherited
prepend([dynamic nodes]) Object
inherited
pseudo(String type) CSSPseudoElement?
inherited
querySelector(String selectors) Element?
inherited
querySelectorAll(String selectors) NodeList
inherited
releasePointerCapture(int pointerId) Object
inherited
remove() Object
Removes this ChildNode from the children list of its parent. remove()
@experimental, inherited
removeAttribute(String qualifiedName) Object
Removes the named attribute from the current node. element.removeAttribute(attrName); [...]
inherited
removeAttributeNode(Attr attr) Attr
Removes the node representation of the named attribute from the current node. removedAttr = element.removeAttributeNode(attributeNode) [...]
inherited
removeAttributeNS(String? namespace, String localName) Object
Removes the attribute with the specified name and namespace, from the current node. element.removeAttributeNS(namespace, attrName); [...]
inherited
removeChild(Node child) Node
Removes a child node from the current element, which must be a child of the current node. var oldChild = node.removeChild(child); Or just: [...]
inherited
removeEventListener(String type, EventListener? callback, [dynamic options]) Object
Removes an event listener from the EventTarget. target.removeEventListener(type, listener, options); target.removeEventListener(type, listener, useCapture); This example shows how to add a mouseover-based event listener that removes a click-based event listener. [...]
inherited
replaceChild(Node node, Node child) Node
Replaces one child Node of the current one with the second one given in parameter. let oldChild = parentNode.replaceChild(newChild, oldChild); [...]
inherited
replaceChildren([dynamic nodes]) Object
inherited
replaceWith([dynamic nodes]) Object
Replaces this ChildNode in the children list of its parent with a set of Node or DOMString objects. DOMString objects are inserted as equivalent Text nodes. replaceWith(...nodes)
@experimental, inherited
requestFullscreen([FullscreenOptions? options]) Promise<Object>
inherited
requestPointerLock() Object
inherited
scroll([dynamic x, dynamic y]) Object
inherited
scrollBy([dynamic x, dynamic y]) Object
inherited
scrollIntoView([dynamic arg]) Object
inherited
scrollTo([dynamic x, dynamic y]) Object
inherited
setAttribute(String qualifiedName, String value) Object
Sets the value of a named attribute of the current node. Element.setAttribute(name, value); [...]
inherited
setAttributeNode(Attr attr) Attr?
Sets the node representation of the named attribute from the current node. var replacedAttr = element.setAttributeNode(attribute); [...]
inherited
setAttributeNodeNS(Attr attr) Attr?
Sets the node representation of the attribute with the specified name and namespace, from the current node. replacedAttr = element.setAttributeNodeNS(attributeNode) [...]
inherited
setAttributeNS(String? namespace, String qualifiedName, String value) Object
Sets the value of the attribute with the specified name and namespace, from the current node. element.setAttributeNS(namespace, name, value) [...]
inherited
setPointerCapture(int pointerId) Object
inherited
spatialNavigationSearch(SpatialNavigationDirection dir, [SpatialNavigationSearchOptions? options]) Node?
inherited
toggleAttribute(String qualifiedName, [bool? force]) bool
Toggles a boolean attribute, removing it if it is present and adding it if it is not present, on the specified element. Element.toggleAttribute(name , force); [...]
inherited
toString() String
A string representation of this object. [...]
inherited
webkitMatchesSelector(String selectors) bool
inherited

Operators

operator ==(Object other) bool
The equality operator. [...]
inherited