Appearance
AreaElement ​
class AreaElement extends HtmlElement implements HtmlHyperlinkElementUtilsAnnotations: @Native.new("HTMLAreaElement")
DOM Area Element, which links regions of an image map with a hyperlink.
The element can also define an uninteractive region of the map.
See also:
<area>on MDN.
Inheritance
Object → EventTarget → Node → Element → HtmlElement → AreaElement
Implemented types
Constructors ​
AreaElement() factory ​
factory AreaElement()Implementation
dart
factory AreaElement() => JS<AreaElement>(
'returns:AreaElement;creates:AreaElement;new:true',
'#.createElement(#)',
document,
"area",
);Properties ​
accessibleNode no setter inherited ​
AccessibleNode? get accessibleNodeInherited from Element.
Implementation
dart
AccessibleNode? get accessibleNode native;alt read / write ​
String get altImplementation
dart
String get alt native;
set alt(String value) native;assignedSlot no setter inherited ​
SlotElement? get assignedSlotInherited from Element.
Implementation
dart
SlotElement? get assignedSlot native;attributes read / write inherited ​
All attributes on this element.
Any modifications to the attribute map will automatically be applied to this element.
This only includes attributes which are not in a namespace (such as 'xlink:href'), additional attributes can be accessed via getNamespacedAttributes.
Inherited from Element.
Implementation
dart
Map<String, String> get attributes => new _ElementAttributeMap(this);
set attributes(Map<String, String> value) {
Map<String, String> attributes = this.attributes;
attributes.clear();
for (String key in value.keys) {
attributes[key] = value[key]!;
}
}baseUri no setter inherited ​
String? get baseUriInherited from Node.
Implementation
dart
@JSName('baseURI')
String? get baseUri native;borderEdge no setter inherited ​
CssRect get borderEdgeAccess the dimensions and position of this element's content + padding + border box.
This returns a rectangle with the dimensions actually available for content in this element, in pixels, regardless of this element's box-sizing property. Unlike getBoundingClientRect, the dimensions of this rectangle will return the same numerical height if the element is hidden or not. This can be used to retrieve jQuery's outerHeight value for an element.
Important note: use of this method will perform CSS calculations that can trigger a browser reflow. Therefore, use of this property during an animation frame is discouraged. See also: Browser Reflow
Inherited from Element.
Implementation
dart
CssRect get borderEdge => new _BorderCssRect(this);childNodes no setter inherited ​
A list of this node's children.
Other resources ​
- Node.childNodes from MDN.
Inherited from Node.
Implementation
dart
@Returns('NodeList')
@Creates('NodeList')
List<Node> get childNodes native;children read / write inherited ​
List of the direct children of this element.
This collection can be used to add and remove elements from the document.
dart
var item = new DivElement();
item.text = 'Something';
document.body.children.add(item) // Item is now displayed on the page.
for (var element in document.body.children) {
element.style.background = 'red'; // Turns every child of body red.
}Inherited from Element.
Implementation
dart
List<Element> get children => new _ChildrenElementList._wrap(this);
set children(List<Element> value) {
// Copy list first since we don't want liveness during iteration.
var copy = value.toList();
var children = this.children;
children.clear();
children.addAll(copy);
}classes read / write inherited ​
CssClassSet get classesThe set of CSS classes applied to this element.
This set makes it easy to add, remove or toggle the classes applied to this element.
dart
element.classes.add('selected');
element.classes.toggle('isOnline');
element.classes.remove('selected');Inherited from Element.
Implementation
dart
CssClassSet get classes => new _ElementCssClassSet(this);
set classes(Iterable<String> value) {
// TODO(sra): Do this without reading the classes in clear() and addAll(),
// or writing the classes in clear().
CssClassSet classSet = classes;
classSet.clear();
classSet.addAll(value);
}className read / write inherited ​
String get classNameInherited from Element.
Implementation
dart
String get className native;
set className(String value) native;client no setter inherited ​
Gets the position of this element relative to the client area of the page.
Inherited from Element.
Implementation
dart
Rectangle get client =>
new Rectangle(clientLeft!, clientTop!, clientWidth, clientHeight);clientHeight no setter inherited ​
int get clientHeightInherited from Element.
Implementation
dart
int get clientHeight native;clientLeft no setter inherited ​
int? get clientLeftInherited from Element.
Implementation
dart
int? get clientLeft native;clientTop no setter inherited ​
int? get clientTopInherited from Element.
Implementation
dart
int? get clientTop native;clientWidth no setter inherited ​
int get clientWidthInherited from Element.
Implementation
dart
int get clientWidth native;computedName no setter inherited ​
String? get computedNameInherited from Element.
Implementation
dart
String? get computedName native;computedRole no setter inherited ​
String? get computedRoleInherited from Element.
Implementation
dart
String? get computedRole native;contentEdge no setter inherited ​
CssRect get contentEdgeAccess this element's content position.
This returns a rectangle with the dimensions actually available for content in this element, in pixels, regardless of this element's box-sizing property. Unlike getBoundingClientRect, the dimensions of this rectangle will return the same numerical height if the element is hidden or not.
Important note: use of this method will perform CSS calculations that can trigger a browser reflow. Therefore, use of this property during an animation frame is discouraged. See also: Browser Reflow
Inherited from Element.
Implementation
dart
CssRect get contentEdge => new _ContentCssRect(this);contentEditable read / write inherited ​
String get contentEditableInherited from Element.
Implementation
dart
String get contentEditable native;
set contentEditable(String value) native;coords read / write ​
String get coordsImplementation
dart
String get coords native;
set coords(String value) native;dataset read / write inherited ​
Allows access to all custom data attributes (data-*) set on this element.
Any data attributes in the markup will be converted to camel-cased keys in the map based on these conversion rules.
For example, HTML specified as:
dart
<div data-my-random-value='value'></div>Would be accessed in Dart as:
dart
var value = element.dataset['myRandomValue'];See also:
Inherited from Element.
Implementation
dart
Map<String, String> get dataset => new _DataAttributeMap(attributes);
set dataset(Map<String, String> value) {
final data = this.dataset;
data.clear();
for (String key in value.keys) {
data[key] = value[key]!;
}
}dir read / write inherited ​
String? get dirInherited from Element.
Implementation
dart
String? get dir native;
set dir(String? value) native;documentOffset no setter inherited ​
Provides the coordinates of the element relative to the top of the document.
This method is the Dart equivalent to jQuery's offset method.
Inherited from Element.
Implementation
dart
Point get documentOffset => offsetTo(document.documentElement!);download read / write ​
String? get downloadImplementation
dart
String? get download native;
set download(String? value) native;draggable read / write inherited ​
bool get draggableIndicates whether the element can be dragged and dropped.
Other resources ​
- Drag and drop sample based on the tutorial from HTML5Rocks.
- Drag and drop specification from WHATWG.
Inherited from Element.
Implementation
dart
bool get draggable native;
set draggable(bool value) native;firstChild no setter inherited ​
Node? get firstChildThe first child of this node.
Other resources ​
- Node.firstChild from MDN.
Inherited from Node.
Implementation
dart
Node? get firstChild native;hash read / write override ​
String? get hashImplementation
dart
String? get hash native;
set hash(String? value) native;hashCode no setter inherited ​
int get hashCodeInherited from Interceptor.
Implementation
dart
int get hashCode => Primitives.objectHashCode(this);hidden read / write inherited ​
bool get hiddenIndicates whether the element is not relevant to the page's current state.
Other resources ​
- Hidden attribute specification from WHATWG.
Inherited from Element.
Implementation
dart
bool get hidden native;
set hidden(bool value) native;host read / write override ​
String? get hostImplementation
dart
String? get host native;
set host(String? value) native;hostname read / write override ​
String? get hostnameImplementation
dart
String? get hostname native;
set hostname(String? value) native;href read / write override ​
String? get hrefImplementation
dart
String? get href native;
set href(String? value) native;id read / write inherited ​
String get idInherited from Element.
Implementation
dart
String get id native;
set id(String value) native;inert read / write inherited ​
bool? get inertInherited from Element.
Implementation
dart
bool? get inert native;
set inert(bool? value) native;innerHtml read / write inherited ​
String? get innerHtmlParses the HTML fragment and sets it as the contents of this element.
This uses the default sanitization behavior to sanitize the HTML fragment, use setInnerHtml to override the default behavior.
Inherited from Element.
Implementation
dart
String? get innerHtml => _innerHtml;
set innerHtml(String? html) {
this.setInnerHtml(html);
}innerText read / write inherited ​
String get innerTextInherited from Element.
Implementation
dart
@JSName('innerText')
String get innerText native;
set innerText(String value) native;inputMode read / write inherited ​
String? get inputModeInherited from Element.
Implementation
dart
String? get inputMode native;
set inputMode(String? value) native;isConnected no setter inherited ​
bool? get isConnectedInherited from Node.
Implementation
dart
bool? get isConnected native;isContentEditable no setter inherited ​
bool? get isContentEditableInherited from Element.
Implementation
dart
bool? get isContentEditable native;lang read / write inherited ​
String? get langInherited from Element.
Implementation
dart
String? get lang native;
set lang(String? value) native;lastChild no setter inherited ​
Node? get lastChildThe last child of this node.
Other resources ​
- Node.lastChild from MDN.
Inherited from Node.
Implementation
dart
Node? get lastChild native;localName no setter inherited ​
String get localNameInherited from Element.
Implementation
dart
@Returns('String')
// Non-null for Elements.
String get localName => JS('String', '#', _localName);marginEdge no setter inherited ​
CssRect get marginEdgeAccess the dimensions and position of this element's content + padding + border + margin box.
This returns a rectangle with the dimensions actually available for content in this element, in pixels, regardless of this element's box-sizing property. Unlike getBoundingClientRect, the dimensions of this rectangle will return the same numerical height if the element is hidden or not. This can be used to retrieve jQuery's outerHeight value for an element.
Important note: use of this method will perform CSS calculations that can trigger a browser reflow. Therefore, use of this property during an animation frame is discouraged. See also: Browser Reflow
Inherited from Element.
Implementation
dart
CssRect get marginEdge => new _MarginCssRect(this);namespaceUri no setter inherited ​
String? get namespaceUriA URI that identifies the XML namespace of this element.
null if no namespace URI is specified.
Other resources ​
- Node.namespaceURI from W3C.
Inherited from Element.
Implementation
dart
String? get namespaceUri => _namespaceUri;nextElementSibling no setter inherited ​
Element? get nextElementSiblingInherited from Element.
Implementation
dart
Element? get nextElementSibling native;nextNode no setter inherited ​
Node? get nextNodeThe next sibling node.
Other resources ​
- Node.nextSibling from MDN.
Inherited from Node.
Implementation
dart
@JSName('nextSibling')
/**
* The next sibling node.
*
* ## Other resources
*
* * [Node.nextSibling](https://developer.mozilla.org/en-US/docs/Web/API/Node.nextSibling)
* from MDN.
*/
Node? get nextNode native;nodeName no setter inherited ​
String? get nodeNameThe name of this node.
This varies by this node's nodeType.
Other resources ​
- Node.nodeName from MDN. This page contains a table of nodeName values for each nodeType.
Inherited from Node.
Implementation
dart
String? get nodeName native;nodes read / write inherited ​
A modifiable list of this node's children.
Inherited from Node.
Implementation
dart
List<Node> get nodes {
return new _ChildNodeListLazy(this);
}
set nodes(Iterable<Node> value) {
// Copy list first since we don't want liveness during iteration.
// TODO(jacobr): there is a better way to do this.
var copy = value.toList();
text = '';
for (Node node in copy) {
append(node);
}
}nodeType no setter inherited ​
int get nodeTypeThe type of node.
This value is one of:
- ATTRIBUTE_NODE if this node is an attribute.
- CDATA_SECTION_NODE if this node is a CDataSection.
- COMMENT_NODE if this node is a Comment.
- DOCUMENT_FRAGMENT_NODE if this node is a DocumentFragment.
- DOCUMENT_NODE if this node is a Document.
- DOCUMENT_TYPE_NODE if this node is a
_DocumentTypenode. - ELEMENT_NODE if this node is an Element.
- ENTITY_NODE if this node is an entity.
- ENTITY_REFERENCE_NODE if this node is an entity reference.
- NOTATION_NODE if this node is a notation.
- PROCESSING_INSTRUCTION_NODE if this node is a ProcessingInstruction.
- TEXT_NODE if this node is a Text node.
Other resources ​
- Node.nodeType from MDN.
Inherited from Node.
Implementation
dart
int get nodeType native;nodeValue no setter inherited ​
String? get nodeValueThe value of this node.
This varies by this type's nodeType.
Other resources ​
- Node.nodeValue from MDN. This page contains a table of nodeValue values for each nodeType.
Inherited from Node.
Implementation
dart
String? get nodeValue native;nonce read / write inherited ​
String? get nonceInherited from HtmlElement.
Implementation
dart
String? get nonce native;
set nonce(String? value) native;offset no setter inherited ​
Gets the offset of this element relative to its offsetParent.
Inherited from Element.
Implementation
dart
Rectangle get offset =>
new Rectangle(offsetLeft, offsetTop, offsetWidth, offsetHeight);offsetHeight no setter inherited ​
int get offsetHeightInherited from Element.
Implementation
dart
int get offsetHeight => JS<num>('num', '#.offsetHeight', this).round();offsetLeft no setter inherited ​
int get offsetLeftInherited from Element.
Implementation
dart
int get offsetLeft => JS<num>('num', '#.offsetLeft', this).round();offsetParent no setter inherited ​
Element? get offsetParentInherited from Element.
Implementation
dart
Element? get offsetParent native;offsetTop no setter inherited ​
int get offsetTopInherited from Element.
Implementation
dart
int get offsetTop => JS<num>('num', '#.offsetTop', this).round();offsetWidth no setter inherited ​
int get offsetWidthInherited from Element.
Implementation
dart
int get offsetWidth => JS<num>('num', '#.offsetWidth', this).round();on no setter inherited ​
ElementEvents get onThis is an ease-of-use accessor for event streams which should only be used when an explicit accessor is not available.
Inherited from Element.
Implementation
dart
ElementEvents get on => new ElementEvents(this);onAbort no setter inherited ​
ElementStream<Event> get onAbortStream of abort events handled by this Element.
Inherited from Element.
Implementation
dart
ElementStream<Event> get onAbort => abortEvent.forElement(this);onBeforeCopy no setter inherited ​
ElementStream<Event> get onBeforeCopyStream of beforecopy events handled by this Element.
Inherited from Element.
Implementation
dart
ElementStream<Event> get onBeforeCopy => beforeCopyEvent.forElement(this);onBeforeCut no setter inherited ​
ElementStream<Event> get onBeforeCutStream of beforecut events handled by this Element.
Inherited from Element.
Implementation
dart
ElementStream<Event> get onBeforeCut => beforeCutEvent.forElement(this);onBeforePaste no setter inherited ​
ElementStream<Event> get onBeforePasteStream of beforepaste events handled by this Element.
Inherited from Element.
Implementation
dart
ElementStream<Event> get onBeforePaste => beforePasteEvent.forElement(this);onBlur no setter inherited ​
ElementStream<Event> get onBlurStream of blur events handled by this Element.
Inherited from Element.
Implementation
dart
ElementStream<Event> get onBlur => blurEvent.forElement(this);onCanPlay no setter inherited ​
ElementStream<Event> get onCanPlayInherited from Element.
Implementation
dart
ElementStream<Event> get onCanPlay => canPlayEvent.forElement(this);onCanPlayThrough no setter inherited ​
ElementStream<Event> get onCanPlayThroughInherited from Element.
Implementation
dart
ElementStream<Event> get onCanPlayThrough =>
canPlayThroughEvent.forElement(this);onChange no setter inherited ​
ElementStream<Event> get onChangeStream of change events handled by this Element.
Inherited from Element.
Implementation
dart
ElementStream<Event> get onChange => changeEvent.forElement(this);onClick no setter inherited ​
ElementStream<MouseEvent> get onClickStream of click events handled by this Element.
Inherited from Element.
Implementation
dart
ElementStream<MouseEvent> get onClick => clickEvent.forElement(this);onContextMenu no setter inherited ​
ElementStream<MouseEvent> get onContextMenuStream of contextmenu events handled by this Element.
Inherited from Element.
Implementation
dart
ElementStream<MouseEvent> get onContextMenu =>
contextMenuEvent.forElement(this);onCopy no setter inherited ​
ElementStream<ClipboardEvent> get onCopyStream of copy events handled by this Element.
Inherited from Element.
Implementation
dart
ElementStream<ClipboardEvent> get onCopy => copyEvent.forElement(this);onCut no setter inherited ​
ElementStream<ClipboardEvent> get onCutStream of cut events handled by this Element.
Inherited from Element.
Implementation
dart
ElementStream<ClipboardEvent> get onCut => cutEvent.forElement(this);onDoubleClick no setter inherited ​
ElementStream<Event> get onDoubleClickStream of doubleclick events handled by this Element.
Inherited from Element.
Implementation
dart
@DomName('Element.ondblclick')
ElementStream<Event> get onDoubleClick => doubleClickEvent.forElement(this);onDrag no setter inherited ​
ElementStream<MouseEvent> get onDragA stream of drag events fired when this element currently being dragged.
A drag event is added to this stream as soon as the drag begins. A drag event is also added to this stream at intervals while the drag operation is still ongoing.
Other resources ​
- Drag and drop sample based on the tutorial from HTML5Rocks.
- Drag and drop specification from WHATWG.
Inherited from Element.
Implementation
dart
ElementStream<MouseEvent> get onDrag => dragEvent.forElement(this);onDragEnd no setter inherited ​
ElementStream<MouseEvent> get onDragEndA stream of dragend events fired when this element completes a drag operation.
Other resources ​
- Drag and drop sample based on the tutorial from HTML5Rocks.
- Drag and drop specification from WHATWG.
Inherited from Element.
Implementation
dart
ElementStream<MouseEvent> get onDragEnd => dragEndEvent.forElement(this);onDragEnter no setter inherited ​
ElementStream<MouseEvent> get onDragEnterA stream of dragenter events fired when a dragged object is first dragged over this element.
Other resources ​
- Drag and drop sample based on the tutorial from HTML5Rocks.
- Drag and drop specification from WHATWG.
Inherited from Element.
Implementation
dart
ElementStream<MouseEvent> get onDragEnter => dragEnterEvent.forElement(this);onDragLeave no setter inherited ​
ElementStream<MouseEvent> get onDragLeaveA stream of dragleave events fired when an object being dragged over this element leaves this element's target area.
Other resources ​
- Drag and drop sample based on the tutorial from HTML5Rocks.
- Drag and drop specification from WHATWG.
Inherited from Element.
Implementation
dart
ElementStream<MouseEvent> get onDragLeave => dragLeaveEvent.forElement(this);onDragOver no setter inherited ​
ElementStream<MouseEvent> get onDragOverA stream of dragover events fired when a dragged object is currently being dragged over this element.
Other resources ​
- Drag and drop sample based on the tutorial from HTML5Rocks.
- Drag and drop specification from WHATWG.
Inherited from Element.
Implementation
dart
ElementStream<MouseEvent> get onDragOver => dragOverEvent.forElement(this);onDragStart no setter inherited ​
ElementStream<MouseEvent> get onDragStartA stream of dragstart events fired when this element starts being dragged.
Other resources ​
- Drag and drop sample based on the tutorial from HTML5Rocks.
- Drag and drop specification from WHATWG.
Inherited from Element.
Implementation
dart
ElementStream<MouseEvent> get onDragStart => dragStartEvent.forElement(this);onDrop no setter inherited ​
ElementStream<MouseEvent> get onDropA stream of drop events fired when a dragged object is dropped on this element.
Other resources ​
- Drag and drop sample based on the tutorial from HTML5Rocks.
- Drag and drop specification from WHATWG.
Inherited from Element.
Implementation
dart
ElementStream<MouseEvent> get onDrop => dropEvent.forElement(this);onDurationChange no setter inherited ​
ElementStream<Event> get onDurationChangeInherited from Element.
Implementation
dart
ElementStream<Event> get onDurationChange =>
durationChangeEvent.forElement(this);onEmptied no setter inherited ​
ElementStream<Event> get onEmptiedInherited from Element.
Implementation
dart
ElementStream<Event> get onEmptied => emptiedEvent.forElement(this);onEnded no setter inherited ​
ElementStream<Event> get onEndedInherited from Element.
Implementation
dart
ElementStream<Event> get onEnded => endedEvent.forElement(this);onError no setter inherited ​
ElementStream<Event> get onErrorStream of error events handled by this Element.
Inherited from Element.
Implementation
dart
ElementStream<Event> get onError => errorEvent.forElement(this);onFocus no setter inherited ​
ElementStream<Event> get onFocusStream of focus events handled by this Element.
Inherited from Element.
Implementation
dart
ElementStream<Event> get onFocus => focusEvent.forElement(this);onFullscreenChange no setter inherited ​
ElementStream<Event> get onFullscreenChangeStream of fullscreenchange events handled by this Element.
Inherited from Element.
Implementation
dart
ElementStream<Event> get onFullscreenChange =>
fullscreenChangeEvent.forElement(this);onFullscreenError no setter inherited ​
ElementStream<Event> get onFullscreenErrorStream of fullscreenerror events handled by this Element.
Inherited from Element.
Implementation
dart
ElementStream<Event> get onFullscreenError =>
fullscreenErrorEvent.forElement(this);onInput no setter inherited ​
ElementStream<Event> get onInputStream of input events handled by this Element.
Inherited from Element.
Implementation
dart
ElementStream<Event> get onInput => inputEvent.forElement(this);onInvalid no setter inherited ​
ElementStream<Event> get onInvalidStream of invalid events handled by this Element.
Inherited from Element.
Implementation
dart
ElementStream<Event> get onInvalid => invalidEvent.forElement(this);onKeyDown no setter inherited ​
ElementStream<KeyboardEvent> get onKeyDownStream of keydown events handled by this Element.
Inherited from Element.
Implementation
dart
ElementStream<KeyboardEvent> get onKeyDown => keyDownEvent.forElement(this);onKeyPress no setter inherited ​
ElementStream<KeyboardEvent> get onKeyPressStream of keypress events handled by this Element.
Inherited from Element.
Implementation
dart
ElementStream<KeyboardEvent> get onKeyPress => keyPressEvent.forElement(this);onKeyUp no setter inherited ​
ElementStream<KeyboardEvent> get onKeyUpStream of keyup events handled by this Element.
Inherited from Element.
Implementation
dart
ElementStream<KeyboardEvent> get onKeyUp => keyUpEvent.forElement(this);onLoad no setter inherited ​
ElementStream<Event> get onLoadStream of load events handled by this Element.
Inherited from Element.
Implementation
dart
ElementStream<Event> get onLoad => loadEvent.forElement(this);onLoadedData no setter inherited ​
ElementStream<Event> get onLoadedDataInherited from Element.
Implementation
dart
ElementStream<Event> get onLoadedData => loadedDataEvent.forElement(this);onLoadedMetadata no setter inherited ​
ElementStream<Event> get onLoadedMetadataInherited from Element.
Implementation
dart
ElementStream<Event> get onLoadedMetadata =>
loadedMetadataEvent.forElement(this);onMouseDown no setter inherited ​
ElementStream<MouseEvent> get onMouseDownStream of mousedown events handled by this Element.
Inherited from Element.
Implementation
dart
ElementStream<MouseEvent> get onMouseDown => mouseDownEvent.forElement(this);onMouseEnter no setter inherited ​
ElementStream<MouseEvent> get onMouseEnterStream of mouseenter events handled by this Element.
Inherited from Element.
Implementation
dart
ElementStream<MouseEvent> get onMouseEnter =>
mouseEnterEvent.forElement(this);onMouseLeave no setter inherited ​
ElementStream<MouseEvent> get onMouseLeaveStream of mouseleave events handled by this Element.
Inherited from Element.
Implementation
dart
ElementStream<MouseEvent> get onMouseLeave =>
mouseLeaveEvent.forElement(this);onMouseMove no setter inherited ​
ElementStream<MouseEvent> get onMouseMoveStream of mousemove events handled by this Element.
Inherited from Element.
Implementation
dart
ElementStream<MouseEvent> get onMouseMove => mouseMoveEvent.forElement(this);onMouseOut no setter inherited ​
ElementStream<MouseEvent> get onMouseOutStream of mouseout events handled by this Element.
Inherited from Element.
Implementation
dart
ElementStream<MouseEvent> get onMouseOut => mouseOutEvent.forElement(this);onMouseOver no setter inherited ​
ElementStream<MouseEvent> get onMouseOverStream of mouseover events handled by this Element.
Inherited from Element.
Implementation
dart
ElementStream<MouseEvent> get onMouseOver => mouseOverEvent.forElement(this);onMouseUp no setter inherited ​
ElementStream<MouseEvent> get onMouseUpStream of mouseup events handled by this Element.
Inherited from Element.
Implementation
dart
ElementStream<MouseEvent> get onMouseUp => mouseUpEvent.forElement(this);onMouseWheel no setter inherited ​
ElementStream<WheelEvent> get onMouseWheelStream of mousewheel events handled by this Element.
Inherited from Element.
Implementation
dart
ElementStream<WheelEvent> get onMouseWheel =>
mouseWheelEvent.forElement(this);onPaste no setter inherited ​
ElementStream<ClipboardEvent> get onPasteStream of paste events handled by this Element.
Inherited from Element.
Implementation
dart
ElementStream<ClipboardEvent> get onPaste => pasteEvent.forElement(this);onPause no setter inherited ​
ElementStream<Event> get onPauseInherited from Element.
Implementation
dart
ElementStream<Event> get onPause => pauseEvent.forElement(this);onPlay no setter inherited ​
ElementStream<Event> get onPlayInherited from Element.
Implementation
dart
ElementStream<Event> get onPlay => playEvent.forElement(this);onPlaying no setter inherited ​
ElementStream<Event> get onPlayingInherited from Element.
Implementation
dart
ElementStream<Event> get onPlaying => playingEvent.forElement(this);onRateChange no setter inherited ​
ElementStream<Event> get onRateChangeInherited from Element.
Implementation
dart
ElementStream<Event> get onRateChange => rateChangeEvent.forElement(this);onReset no setter inherited ​
ElementStream<Event> get onResetStream of reset events handled by this Element.
Inherited from Element.
Implementation
dart
ElementStream<Event> get onReset => resetEvent.forElement(this);onResize no setter inherited ​
ElementStream<Event> get onResizeInherited from Element.
Implementation
dart
ElementStream<Event> get onResize => resizeEvent.forElement(this);onScroll no setter inherited ​
ElementStream<Event> get onScrollStream of scroll events handled by this Element.
Inherited from Element.
Implementation
dart
ElementStream<Event> get onScroll => scrollEvent.forElement(this);onSearch no setter inherited ​
ElementStream<Event> get onSearchStream of search events handled by this Element.
Inherited from Element.
Implementation
dart
ElementStream<Event> get onSearch => searchEvent.forElement(this);onSeeked no setter inherited ​
ElementStream<Event> get onSeekedInherited from Element.
Implementation
dart
ElementStream<Event> get onSeeked => seekedEvent.forElement(this);onSeeking no setter inherited ​
ElementStream<Event> get onSeekingInherited from Element.
Implementation
dart
ElementStream<Event> get onSeeking => seekingEvent.forElement(this);onSelect no setter inherited ​
ElementStream<Event> get onSelectStream of select events handled by this Element.
Inherited from Element.
Implementation
dart
ElementStream<Event> get onSelect => selectEvent.forElement(this);onSelectStart no setter inherited ​
ElementStream<Event> get onSelectStartStream of selectstart events handled by this Element.
Inherited from Element.
Implementation
dart
ElementStream<Event> get onSelectStart => selectStartEvent.forElement(this);onStalled no setter inherited ​
ElementStream<Event> get onStalledInherited from Element.
Implementation
dart
ElementStream<Event> get onStalled => stalledEvent.forElement(this);onSubmit no setter inherited ​
ElementStream<Event> get onSubmitStream of submit events handled by this Element.
Inherited from Element.
Implementation
dart
ElementStream<Event> get onSubmit => submitEvent.forElement(this);onSuspend no setter inherited ​
ElementStream<Event> get onSuspendInherited from Element.
Implementation
dart
ElementStream<Event> get onSuspend => suspendEvent.forElement(this);onTimeUpdate no setter inherited ​
ElementStream<Event> get onTimeUpdateInherited from Element.
Implementation
dart
ElementStream<Event> get onTimeUpdate => timeUpdateEvent.forElement(this);onTouchCancel no setter inherited ​
ElementStream<TouchEvent> get onTouchCancelStream of touchcancel events handled by this Element.
Inherited from Element.
Implementation
dart
ElementStream<TouchEvent> get onTouchCancel =>
touchCancelEvent.forElement(this);onTouchEnd no setter inherited ​
ElementStream<TouchEvent> get onTouchEndStream of touchend events handled by this Element.
Inherited from Element.
Implementation
dart
ElementStream<TouchEvent> get onTouchEnd => touchEndEvent.forElement(this);onTouchEnter no setter inherited ​
ElementStream<TouchEvent> get onTouchEnterStream of touchenter events handled by this Element.
Inherited from Element.
Implementation
dart
ElementStream<TouchEvent> get onTouchEnter =>
touchEnterEvent.forElement(this);onTouchLeave no setter inherited ​
ElementStream<TouchEvent> get onTouchLeaveStream of touchleave events handled by this Element.
Inherited from Element.
Implementation
dart
ElementStream<TouchEvent> get onTouchLeave =>
touchLeaveEvent.forElement(this);onTouchMove no setter inherited ​
ElementStream<TouchEvent> get onTouchMoveStream of touchmove events handled by this Element.
Inherited from Element.
Implementation
dart
ElementStream<TouchEvent> get onTouchMove => touchMoveEvent.forElement(this);onTouchStart no setter inherited ​
ElementStream<TouchEvent> get onTouchStartStream of touchstart events handled by this Element.
Inherited from Element.
Implementation
dart
ElementStream<TouchEvent> get onTouchStart =>
touchStartEvent.forElement(this);onTransitionEnd no setter inherited ​
ElementStream<TransitionEvent> get onTransitionEndStream of transitionend events handled by this Element.
Inherited from Element.
Implementation
dart
@SupportedBrowser(SupportedBrowser.CHROME)
@SupportedBrowser(SupportedBrowser.FIREFOX)
@SupportedBrowser(SupportedBrowser.IE, '10')
@SupportedBrowser(SupportedBrowser.SAFARI)
ElementStream<TransitionEvent> get onTransitionEnd =>
transitionEndEvent.forElement(this);onVolumeChange no setter inherited ​
ElementStream<Event> get onVolumeChangeInherited from Element.
Implementation
dart
ElementStream<Event> get onVolumeChange => volumeChangeEvent.forElement(this);onWaiting no setter inherited ​
ElementStream<Event> get onWaitingInherited from Element.
Implementation
dart
ElementStream<Event> get onWaiting => waitingEvent.forElement(this);onWheel no setter inherited ​
ElementStream<WheelEvent> get onWheelInherited from Element.
Implementation
dart
ElementStream<WheelEvent> get onWheel => wheelEvent.forElement(this);origin no setter override ​
String? get originImplementation
dart
String? get origin native;outerHtml no setter inherited ​
String? get outerHtmlInherited from Element.
Implementation
dart
@JSName('outerHTML')
String? get outerHtml native;ownerDocument no setter inherited ​
Document? get ownerDocumentThe document this node belongs to.
Returns null if this node does not belong to any document.
Other resources ​
- Node.ownerDocument from MDN.
Inherited from Node.
Implementation
dart
Document? get ownerDocument native;paddingEdge no setter inherited ​
CssRect get paddingEdgeAccess the dimensions and position of this element's content + padding box.
This returns a rectangle with the dimensions actually available for content in this element, in pixels, regardless of this element's box-sizing property. Unlike getBoundingClientRect, the dimensions of this rectangle will return the same numerical height if the element is hidden or not. This can be used to retrieve jQuery's innerHeight value for an element. This is also a rectangle equalling the dimensions of clientHeight and clientWidth.
Important note: use of this method will perform CSS calculations that can trigger a browser reflow. Therefore, use of this property during an animation frame is discouraged. See also: Browser Reflow
Inherited from Element.
Implementation
dart
CssRect get paddingEdge => new _PaddingCssRect(this);parent no setter inherited ​
Element? get parentThe parent element of this node.
Returns null if this node either does not have a parent or its parent is not an element.
Other resources ​
- Node.parentElement from W3C.
Inherited from Node.
Implementation
dart
@JSName('parentElement')
/**
* The parent element of this node.
*
* Returns null if this node either does not have a parent or its parent is
* not an element.
*
* ## Other resources
*
* * [Node.parentElement](https://developer.mozilla.org/en-US/docs/Web/API/Node.parentElement)
* from W3C.
*/
Element? get parent native;parentNode no setter inherited ​
Node? get parentNodeThe parent node of this node.
Other resources ​
- Node.parentNode from MDN.
Inherited from Node.
Implementation
dart
Node? get parentNode native;password read / write override ​
String? get passwordImplementation
dart
String? get password native;
set password(String? value) native;pathname read / write override ​
String? get pathnameImplementation
dart
String? get pathname native;
set pathname(String? value) native;port read / write override ​
String? get portImplementation
dart
String? get port native;
set port(String? value) native;previousElementSibling no setter inherited ​
Element? get previousElementSiblingInherited from Element.
Implementation
dart
Element? get previousElementSibling native;previousNode no setter inherited ​
Node? get previousNodeThe previous sibling node.
Other resources ​
- Node.previousSibling from MDN.
Inherited from Node.
Implementation
dart
@JSName('previousSibling')
/**
* The previous sibling node.
*
* ## Other resources
*
* * [Node.previousSibling](https://developer.mozilla.org/en-US/docs/Web/API/Node.previousSibling)
* from MDN.
*/
Node? get previousNode native;protocol read / write override ​
String? get protocolImplementation
dart
String? get protocol native;
set protocol(String? value) native;referrerPolicy read / write ​
String? get referrerPolicyImplementation
dart
String? get referrerPolicy native;
set referrerPolicy(String? value) native;rel read / write ​
String get relImplementation
dart
String get rel native;
set rel(String value) native;runtimeType no setter inherited ​
Type get runtimeTypeInherited from Interceptor.
Implementation
dart
Type get runtimeType =>
getRuntimeTypeOfInterceptorNotArray(getInterceptor(this), this);scrollHeight no setter inherited ​
int get scrollHeightInherited from Element.
Implementation
dart
int get scrollHeight => JS<num>('num', '#.scrollHeight', this).round();scrollLeft read / write inherited ​
int get scrollLeftInherited from Element.
Implementation
dart
int get scrollLeft => JS<num>('num', '#.scrollLeft', this).round();
set scrollLeft(int value) {
JS("void", "#.scrollLeft = #", this, value.round());
}scrollTop read / write inherited ​
int get scrollTopInherited from Element.
Implementation
dart
int get scrollTop => JS<num>('num', '#.scrollTop', this).round();
set scrollTop(int value) {
JS("void", "#.scrollTop = #", this, value.round());
}scrollWidth no setter inherited ​
int get scrollWidthInherited from Element.
Implementation
dart
int get scrollWidth => JS<num>('num', '#.scrollWidth', this).round();search read / write override ​
String? get searchImplementation
dart
String? get search native;
set search(String? value) native;shadowRoot no setter inherited ​
ShadowRoot? get shadowRootThe shadow root of this shadow host.
Other resources ​
- Shadow DOM 101 from HTML5Rocks.
- Shadow DOM specification from W3C.
Inherited from Element.
Implementation
dart
@SupportedBrowser(SupportedBrowser.CHROME, '25')
ShadowRoot? get shadowRoot =>
JS('ShadowRoot|Null', '#.shadowRoot || #.webkitShadowRoot', this, this);shape read / write ​
String get shapeImplementation
dart
String get shape native;
set shape(String value) native;slot read / write inherited ​
String? get slotInherited from Element.
Implementation
dart
String? get slot native;
set slot(String? value) native;spellcheck read / write inherited ​
bool? get spellcheckInherited from Element.
Implementation
dart
bool? get spellcheck native;
set spellcheck(bool? value) native;style no setter inherited ​
CssStyleDeclaration get styleInherited from Element.
Implementation
dart
CssStyleDeclaration get style native;styleMap no setter inherited ​
StylePropertyMap? get styleMapInherited from Element.
Implementation
dart
StylePropertyMap? get styleMap native;tabIndex read / write inherited ​
int? get tabIndexInherited from Element.
Implementation
dart
int? get tabIndex native;
set tabIndex(int? value) native;tagName no setter inherited ​
String get tagNameInherited from Element.
Implementation
dart
String get tagName native;target read / write ​
String get targetImplementation
dart
String get target native;
set target(String value) native;text read / write inherited ​
String? get textAll text within this node and its descendants.
Other resources ​
- Node.textContent from MDN.
Inherited from Node.
Implementation
dart
@JSName('textContent')
/**
* All text within this node and its descendants.
*
* ## Other resources
*
* * [Node.textContent](https://developer.mozilla.org/en-US/docs/Web/API/Node.textContent)
* from MDN.
*/
String? get text native;
@JSName('textContent')
set text(String? value) native;title read / write inherited ​
String? get titleInherited from Element.
Implementation
dart
String? get title native;
set title(String? value) native;translate read / write inherited ​
bool? get translateSpecifies whether this element's text content changes when the page is localized.
Other resources ​
- The translate attribute from WHATWG.
Inherited from Element.
Implementation
dart
bool? get translate native;
set translate(bool? value) native;username read / write override ​
String? get usernameImplementation
dart
String? get username native;
set username(String? value) native;Methods ​
addEventListener() inherited ​
void addEventListener(
String type,
(dynamic Function(Event event))? listener, [
bool? useCapture,
])Inherited from EventTarget.
Implementation
dart
void addEventListener(
String type,
EventListener? listener, [
bool? useCapture,
]) {
// TODO(leafp): This check is avoid a bug in our dispatch code when
// listener is null. The browser treats this call as a no-op in this
// case, so it's fine to short-circuit it, but we should not have to.
if (listener != null) {
_addEventListener(type, listener, useCapture);
}
}after() inherited ​
void after(Object nodes)Inherited from Element.
Implementation
dart
void after(Object nodes) native;animate() inherited ​
Creates a new AnimationEffect object whose target element is the object on which the method is called, and calls the play() method of the AnimationTimeline object of the document timeline of the node document of the element, passing the newly created AnimationEffect as the argument to the method. Returns an Animation for the effect.
Examples
dart
var animation = elem.animate([{"opacity": 75}, {"opacity": 0}], 200);
var animation = elem.animate([
{"transform": "translate(100px, -100%)"},
{"transform" : "translate(400px, 500px)"}
], 1500);The frames parameter is an Iterable<Map>, where the map entries specify CSS animation effects. The timing parameter can be a double, representing the number of milliseconds for the transition, or a Map with fields corresponding to those of the timing object.
Inherited from Element.
Implementation
dart
@SupportedBrowser(SupportedBrowser.CHROME, '36')
Animation animate(Iterable<Map<String, dynamic>> frames, [timing]) {
if (frames is! Iterable || !(frames.every((x) => x is Map))) {
throw new ArgumentError(
"The frames parameter should be a List of Maps "
"with frame information",
);
}
var convertedFrames;
if (frames is Iterable) {
convertedFrames = frames.map(convertDartToNative_Dictionary).toList();
} else {
convertedFrames = frames;
}
var convertedTiming = timing is Map
? convertDartToNative_Dictionary(timing)
: timing;
return convertedTiming == null
? _animate(convertedFrames)
: _animate(convertedFrames, convertedTiming);
}append() inherited ​
Adds a node to the end of the child nodes list of this node.
If the node already exists in this document, it will be removed from its current parent node, then added to this node.
This method is more efficient than nodes.add, and is the preferred way of appending a child node.
Inherited from Node.
Implementation
dart
@JSName('appendChild')
/**
* Adds a node to the end of the child [nodes] list of this node.
*
* If the node already exists in this document, it will be removed from its
* current parent node, then added to this node.
*
* This method is more efficient than `nodes.add`, and is the preferred
* way of appending a child node.
*/
Node append(Node node) native;appendHtml() inherited ​
void appendHtml(
String text, {
NodeValidator? validator,
NodeTreeSanitizer? treeSanitizer,
})Parses the specified text as HTML and adds the resulting node after the last child of this element.
Inherited from Element.
Implementation
dart
void appendHtml(
String text, {
NodeValidator? validator,
NodeTreeSanitizer? treeSanitizer,
}) {
this.insertAdjacentHtml(
'beforeend',
text,
validator: validator,
treeSanitizer: treeSanitizer,
);
}appendText() inherited ​
void appendText(String text)Adds the specified text after the last child of this element.
Inherited from Element.
Implementation
dart
void appendText(String text) {
this.append(new Text(text));
}attached() inherited ​
void attached()Called by the DOM when this element has been inserted into the live document.
Warning: This API is part of multiple custom element APIs that are no longer supported.
Inherited from Element.
Implementation
dart
void attached() {
// For the deprecation period, call the old callback.
enteredView();
}attachShadow() inherited ​
ShadowRoot attachShadow(Map<dynamic, dynamic> shadowRootInitDict)Inherited from Element.
Implementation
dart
ShadowRoot attachShadow(Map shadowRootInitDict) {
var shadowRootInitDict_1 = convertDartToNative_Dictionary(
shadowRootInitDict,
);
return _attachShadow_1(shadowRootInitDict_1);
}attributeChanged() inherited ​
Called by the DOM whenever an attribute on this has been changed.
Inherited from Element.
Implementation
dart
void attributeChanged(String name, String oldValue, String newValue) {}before() inherited ​
void before(Object nodes)Inherited from Element.
Implementation
dart
void before(Object nodes) native;blur() inherited ​
void blur()Inherited from Element.
Implementation
dart
void blur() native;click() inherited ​
void click()Inherited from Element.
Implementation
dart
void click() native;clone() inherited ​
Returns a copy of this node.
If deep is true, then all of this node's children and descendants are copied as well. If deep is false, then only this node is copied.
Other resources ​
- Node.cloneNode from MDN.
Inherited from Node.
Implementation
dart
@JSName('cloneNode')
/**
* Returns a copy of this node.
*
* If [deep] is `true`, then all of this node's children and descendants are
* copied as well. If [deep] is `false`, then only this node is copied.
*
* ## Other resources
*
* * [Node.cloneNode](https://developer.mozilla.org/en-US/docs/Web/API/Node.cloneNode)
* from MDN.
*/
Node clone(bool? deep) native;closest() inherited ​
Inherited from Element.
Implementation
dart
Element? closest(String selectors) native;contains() inherited ​
Returns true if this node contains the specified node.
Other resources ​
- Node.contains from MDN.
Inherited from Node.
Implementation
dart
bool contains(Node? other) native;createFragment() inherited ​
DocumentFragment createFragment(
String? html, {
NodeValidator? validator,
NodeTreeSanitizer? treeSanitizer,
})Create a DocumentFragment from the HTML fragment and ensure that it follows the sanitization rules specified by the validator or treeSanitizer.
If the default validation behavior is too restrictive then a new NodeValidator should be created, either extending or wrapping a default validator and overriding the validation APIs.
The treeSanitizer is used to walk the generated node tree and sanitize it. A custom treeSanitizer can also be provided to perform special validation rules but since the API is more complex to implement this is discouraged.
The returned tree is guaranteed to only contain nodes and attributes which are allowed by the provided validator.
See also:
Inherited from Element.
Implementation
dart
DocumentFragment createFragment(
String? html, {
NodeValidator? validator,
NodeTreeSanitizer? treeSanitizer,
}) {
if (treeSanitizer == null) {
if (validator == null) {
if (_defaultValidator == null) {
_defaultValidator = new NodeValidatorBuilder.common();
}
validator = _defaultValidator;
}
if (_defaultSanitizer == null) {
_defaultSanitizer = new _ValidatingTreeSanitizer(validator!);
} else {
_defaultSanitizer!.validator = validator!;
}
treeSanitizer = _defaultSanitizer;
} else if (validator != null) {
throw new ArgumentError(
'validator can only be passed if treeSanitizer is null',
);
}
if (_parseDocument == null) {
_parseDocument = document.implementation!.createHtmlDocument('');
_parseRange = _parseDocument!.createRange();
// Workaround for Safari bug. Was also previously Chrome bug 229142
// - URIs are not resolved in new doc.
BaseElement base = _parseDocument!.createElement('base') as BaseElement;
base.href = document.baseUri!;
_parseDocument!.head!.append(base);
}
// TODO(terry): Fixes Chromium 50 change no body after createHtmlDocument()
if (_parseDocument!.body == null) {
_parseDocument!.body =
_parseDocument!.createElement("body") as BodyElement;
}
Element contextElement;
if (this is BodyElement) {
contextElement = _parseDocument!.body!;
} else {
contextElement = _parseDocument!.createElement(tagName);
_parseDocument!.body!.append(contextElement);
}
DocumentFragment fragment;
if (Range.supportsCreateContextualFragment &&
_canBeUsedToCreateContextualFragment) {
_parseRange!.selectNodeContents(contextElement);
// createContextualFragment expects a non-nullable html string.
// If null is passed, it gets converted to 'null' instead.
fragment = _parseRange!.createContextualFragment(html ?? 'null');
} else {
contextElement._innerHtml = html;
fragment = _parseDocument!.createDocumentFragment();
while (contextElement.firstChild != null) {
fragment.append(contextElement.firstChild!);
}
}
if (contextElement != _parseDocument!.body) {
contextElement.remove();
}
treeSanitizer!.sanitizeTree(fragment);
// Copy the fragment over to the main document (fix for 14184)
document.adoptNode(fragment);
return fragment;
}createShadowRoot() inherited ​
ShadowRoot createShadowRoot()Creates a new shadow root for this shadow host.
Other resources ​
- Shadow DOM 101 from HTML5Rocks.
- Shadow DOM specification from W3C.
Inherited from Element.
Implementation
dart
@SupportedBrowser(SupportedBrowser.CHROME, '25')
ShadowRoot createShadowRoot() {
return JS(
'ShadowRoot',
'(#.createShadowRoot || #.webkitCreateShadowRoot).call(#)',
this,
this,
this,
);
}detached() inherited ​
void detached()Called by the DOM when this element has been removed from the live document.
Warning: This API is part of multiple custom element APIs that are no longer supported. draft specification.
Inherited from Element.
Implementation
dart
void detached() {
// For the deprecation period, call the old callback.
leftView();
}dispatchEvent() inherited ​
Inherited from EventTarget.
Implementation
dart
bool dispatchEvent(Event event) native;deprecated enteredView() inherited ​
void enteredView()DEPRECATED
next release
Deprecated*: override attached instead.
Inherited from Element.
Implementation
dart
@deprecated
void enteredView() {}focus() inherited ​
void focus()Inherited from Element.
Implementation
dart
void focus() native;getAnimations() inherited ​
Inherited from Element.
Implementation
dart
List<Animation> getAnimations() native;getAttribute() inherited ​
Inherited from Element.
Implementation
dart
@pragma('dart2js:tryInline')
String? getAttribute(String name) {
// TODO(41258): Delete this assertion after forcing strong mode.
// Protect [name] against string conversion to "null" or "undefined".
assert(name != null, 'Attribute name cannot be null');
return _getAttribute(name);
}getAttributeNames() inherited ​
Inherited from Element.
Implementation
dart
List<String> getAttributeNames() native;getAttributeNS() inherited ​
Inherited from Element.
Implementation
dart
@pragma('dart2js:tryInline')
String? getAttributeNS(String? namespaceURI, String name) {
// TODO(41258): Delete this assertion after forcing strong mode.
// Protect [name] against string conversion to "null" or "undefined".
// [namespaceURI] does not need protecting, both `null` and `undefined` map to `null`.
assert(name != null, 'Attribute name cannot be null');
return _getAttributeNS(namespaceURI, name);
}getBoundingClientRect() inherited ​
Returns the smallest bounding rectangle that encompasses this element's padding, scrollbar, and border.
Other resources ​
- Element.getBoundingClientRect from MDN.
- The getBoundingClientRect() method from W3C.
Inherited from Element.
Implementation
dart
@Creates('_DomRect')
@Returns('_DomRect|Null')
Rectangle getBoundingClientRect() native;getClientRects() inherited ​
Inherited from Element.
Implementation
dart
List<Rectangle> getClientRects() {
var value = _getClientRects();
// If no prototype we need one for the world to hookup to the proper Dart class.
var jsProto = JS('', '#.prototype', value);
if (jsProto == null) {
JS('', '#.prototype = Object.create(null)', value);
}
applyExtension('DOMRectList', value);
return value;
}getComputedStyle() inherited ​
CssStyleDeclaration getComputedStyle([String? pseudoElement])The set of all CSS values applied to this element, including inherited and default values.
The computedStyle contains values that are inherited from other sources, such as parent elements or stylesheets. This differs from the style property, which contains only the values specified directly on this element.
PseudoElement can be values such as ::after, ::before, ::marker, ::line-marker.
See also:
- Cascade and Inheritance from MDN.
- Pseudo-elements from MDN.
Inherited from Element.
Implementation
dart
CssStyleDeclaration getComputedStyle([String? pseudoElement]) {
if (pseudoElement == null) {
pseudoElement = '';
}
// TODO(jacobr): last param should be null, see b/5045788
return window._getComputedStyle(this, pseudoElement);
}getDestinationInsertionPoints() inherited ​
Returns a list of shadow DOM insertion points to which this element is distributed.
Other resources ​
- Shadow DOM specification from W3C.
Inherited from Element.
Implementation
dart
@Returns('NodeList')
@Creates('NodeList')
List<Node> getDestinationInsertionPoints() native;getElementsByClassName() inherited ​
Returns a list of nodes with the given class name inside this element.
Other resources ​
- getElementsByClassName from MDN.
- DOM specification from W3C.
Inherited from Element.
Implementation
dart
@Creates('NodeList|HtmlCollection')
@Returns('NodeList|HtmlCollection')
List<Node> getElementsByClassName(String classNames) native;getNamespacedAttributes() inherited ​
Gets a map for manipulating the attributes of a particular namespace.
This is primarily useful for SVG attributes such as xref:link.
Inherited from Element.
Implementation
dart
Map<String, String> getNamespacedAttributes(String namespace) {
return new _NamespacedAttributeMap(this, namespace);
}getRootNode() inherited ​
Inherited from Node.
Implementation
dart
Node getRootNode([Map? options]) {
if (options != null) {
var options_1 = convertDartToNative_Dictionary(options);
return _getRootNode_1(options_1);
}
return _getRootNode_2();
}hasAttribute() inherited ​
Inherited from Element.
Implementation
dart
@pragma('dart2js:tryInline')
bool hasAttribute(String name) {
// TODO(41258): Delete this assertion after forcing strong mode.
// Protect [name] against string conversion to "null" or "undefined".
assert(name != null, 'Attribute name cannot be null');
return _hasAttribute(name);
}hasAttributeNS() inherited ​
Inherited from Element.
Implementation
dart
@pragma('dart2js:tryInline')
bool hasAttributeNS(String? namespaceURI, String name) {
// TODO(41258): Delete this assertion after forcing strong mode.
// Protect [name] against string conversion to "null" or "undefined".
// [namespaceURI] does not need protecting, both `null` and `undefined` map to `null`.
assert(name != null, 'Attribute name cannot be null');
return _hasAttributeNS(namespaceURI, name);
}hasChildNodes() inherited ​
bool hasChildNodes()Returns true if this node has any children.
Other resources ​
- Node.hasChildNodes from MDN.
Inherited from Node.
Implementation
dart
bool hasChildNodes() native;hasPointerCapture() inherited ​
Inherited from Element.
Implementation
dart
bool hasPointerCapture(int pointerId) native;insertAdjacentElement() inherited ​
Inserts element into the DOM at the specified location.
To see the possible values for where, read the doc for insertAdjacentHtml.
See also:
Inherited from Element.
Implementation
dart
Element insertAdjacentElement(String where, Element element) {
if (JS('bool', '!!#.insertAdjacentElement', this)) {
_insertAdjacentElement(where, element);
} else {
_insertAdjacentNode(where, element);
}
return element;
}insertAdjacentHtml() inherited ​
void insertAdjacentHtml(
String where,
String html, {
NodeValidator? validator,
NodeTreeSanitizer? treeSanitizer,
})Parses text as an HTML fragment and inserts it into the DOM at the specified location.
The where parameter indicates where to insert the HTML fragment:
- 'beforeBegin': Immediately before this element.
- 'afterBegin': As the first child of this element.
- 'beforeEnd': As the last child of this element.
- 'afterEnd': Immediately after this element.
dart
var html = '<div class="something">content</div>';
// Inserts as the first child
document.body.insertAdjacentHtml('afterBegin', html);
var createdElement = document.body.children[0];
print(createdElement.classes[0]); // Prints 'something'See also:
Inherited from Element.
Implementation
dart
void insertAdjacentHtml(
String where,
String html, {
NodeValidator? validator,
NodeTreeSanitizer? treeSanitizer,
}) {
if (treeSanitizer is _TrustedHtmlTreeSanitizer) {
_insertAdjacentHtml(where, html);
} else {
_insertAdjacentNode(
where,
createFragment(
html,
validator: validator,
treeSanitizer: treeSanitizer,
),
);
}
}insertAdjacentText() inherited ​
Inserts text into the DOM at the specified location.
To see the possible values for where, read the doc for insertAdjacentHtml.
See also:
Inherited from Element.
Implementation
dart
void insertAdjacentText(String where, String text) {
if (JS('bool', '!!#.insertAdjacentText', this)) {
_insertAdjacentText(where, text);
} else {
_insertAdjacentNode(where, new Text(text));
}
}insertAllBefore() inherited ​
Inserts all of the nodes into this node directly before child.
See also:
Inherited from Node.
Implementation
dart
void insertAllBefore(Iterable<Node> newNodes, Node child) {
if (newNodes is _ChildNodeListLazy) {
_ChildNodeListLazy otherList = newNodes;
if (identical(otherList._this, this)) {
throw new ArgumentError(newNodes);
}
// Optimized route for copying between nodes.
for (var i = 0, len = otherList.length; i < len; ++i) {
this.insertBefore(otherList._this.firstChild!, child);
}
} else {
for (var node in newNodes) {
this.insertBefore(node, child);
}
}
}insertBefore() inherited ​
Inserts the given node into this node directly before child. If child is null, then the given node is inserted at the end of this node's child nodes.
Other resources ​
- Node.insertBefore from MDN.
Inherited from Node.
Implementation
dart
Node insertBefore(Node node, Node? child) native;deprecated leftView() inherited ​
void leftView()DEPRECATED
next release
Deprecated*: override detached instead.
Inherited from Element.
Implementation
dart
@deprecated
void leftView() {}matches() inherited ​
Checks if this element matches the CSS selectors.
Inherited from Element.
Implementation
dart
bool matches(String selectors) {
if (JS('bool', '!!#.matches', this)) {
return JS('bool', '#.matches(#)', this, selectors);
} else if (JS('bool', '!!#.webkitMatchesSelector', this)) {
return JS('bool', '#.webkitMatchesSelector(#)', this, selectors);
} else if (JS('bool', '!!#.mozMatchesSelector', this)) {
return JS('bool', '#.mozMatchesSelector(#)', this, selectors);
} else if (JS('bool', '!!#.msMatchesSelector', this)) {
return JS('bool', '#.msMatchesSelector(#)', this, selectors);
} else if (JS('bool', '!!#.oMatchesSelector', this)) {
return JS('bool', '#.oMatchesSelector(#)', this, selectors);
} else {
throw new UnsupportedError("Not supported on this platform");
}
}matchesWithAncestors() inherited ​
Checks if this element or any of its parents match the CSS selectors.
Inherited from Element.
Implementation
dart
bool matchesWithAncestors(String selectors) {
var elem = this as Element?;
do {
if (elem!.matches(selectors)) return true;
elem = elem.parent;
} while (elem != null);
return false;
}noSuchMethod() inherited ​
dynamic noSuchMethod(Invocation invocation)Invoked when a nonexistent method or property is accessed.
A dynamic member invocation can attempt to call a member which doesn't exist on the receiving object. Example:
dart
dynamic object = 1;
object.add(42); // Statically allowed, run-time errorThis invalid code will invoke the noSuchMethod method of the integer 1 with an Invocation representing the .add(42) call and arguments (which then throws).
Classes can override noSuchMethod to provide custom behavior for such invalid dynamic invocations.
A class with a non-default noSuchMethod invocation can also omit implementations for members of its interface. Example:
dart
class MockList<T> implements List<T> {
noSuchMethod(Invocation invocation) {
log(invocation);
super.noSuchMethod(invocation); // Will throw.
}
}
void main() {
MockList().add(42);
}This code has no compile-time warnings or errors even though the MockList class has no concrete implementation of any of the List interface methods. Calls to List methods are forwarded to noSuchMethod, so this code will log an invocation similar to Invocation.method(#add, [42]) and then throw.
If a value is returned from noSuchMethod, it becomes the result of the original invocation. If the value is not of a type that can be returned by the original invocation, a type error occurs at the invocation.
The default behavior is to throw a NoSuchMethodError.
Inherited from Interceptor.
Implementation
dart
dynamic noSuchMethod(Invocation invocation) {
throw NoSuchMethodError.withInvocation(this, invocation);
}offsetTo() inherited ​
Provides the offset of this element's borderEdge relative to the specified parent.
This is the Dart equivalent of jQuery's position method. Unlike jQuery's position, however, parent can be any parent element of this, rather than only this's immediate offsetParent. If the specified element is not an offset parent or transitive offset parent to this element, an ArgumentError is thrown.
Inherited from Element.
Implementation
dart
Point offsetTo(Element parent) {
return Element._offsetToHelper(this, parent);
}querySelector() inherited ​
Finds the first descendant element of this element that matches the specified group of selectors.
selectors should be a string using CSS selector syntax.
dart
// Gets the first descendant with the class 'classname'
var element = element.querySelector('.className');
// Gets the element with id 'id'
var element = element.querySelector('#id');
// Gets the first descendant [ImageElement]
var img = element.querySelector('img');For details about CSS selector syntax, see the CSS selector specification.
Inherited from Element.
Implementation
dart
Element? querySelector(String selectors) native;querySelectorAll() inherited ​
ElementList<T> querySelectorAll<T extends Element>(String selectors)Finds all descendent elements of this element that match the specified group of selectors.
selectors should be a string using CSS selector syntax.
dart
var items = element.querySelectorAll('.itemClassName');For details about CSS selector syntax, see the CSS selector specification.
Inherited from Element.
Implementation
dart
ElementList<T> querySelectorAll<T extends Element>(String selectors) =>
new _FrozenElementList<T>._wrap(_querySelectorAll(selectors));releasePointerCapture() inherited ​
void releasePointerCapture(int pointerId)Inherited from Element.
Implementation
dart
void releasePointerCapture(int pointerId) native;remove() inherited ​
void remove()Removes this node from the DOM.
Inherited from Node.
Implementation
dart
void remove() {
// TODO(jacobr): should we throw an exception if parent is already null?
// TODO(vsm): Use the native remove when available.
if (this.parentNode != null) {
final Node parent = this.parentNode!;
parent._removeChild(this);
}
}removeAttribute() inherited ​
void removeAttribute(String name)Inherited from Element.
Implementation
dart
@pragma('dart2js:tryInline')
void removeAttribute(String name) {
// TODO(41258): Delete this assertion after forcing strong mode.
// Protect [name] against string conversion to "null" or "undefined".
assert(name != null, 'Attribute name cannot be null');
_removeAttribute(name);
}removeAttributeNS() inherited ​
Inherited from Element.
Implementation
dart
@pragma('dart2js:tryInline')
void removeAttributeNS(String? namespaceURI, String name) {
// TODO(41258): Delete this assertion after forcing strong mode.
// Protect [name] against string conversion to "null" or "undefined".
assert(name != null, 'Attribute name cannot be null');
_removeAttributeNS(namespaceURI, name);
}removeEventListener() inherited ​
void removeEventListener(
String type,
(dynamic Function(Event event))? listener, [
bool? useCapture,
])Inherited from EventTarget.
Implementation
dart
void removeEventListener(
String type,
EventListener? listener, [
bool? useCapture,
]) {
// TODO(leafp): This check is avoid a bug in our dispatch code when
// listener is null. The browser treats this call as a no-op in this
// case, so it's fine to short-circuit it, but we should not have to.
if (listener != null) {
_removeEventListener(type, listener, useCapture);
}
}replaceWith() inherited ​
Replaces this node with another node.
Inherited from Node.
Implementation
dart
Node replaceWith(Node otherNode) {
try {
final Node parent = this.parentNode!;
parent._replaceChild(otherNode, this);
} catch (e) {}
return this;
}requestFullscreen() inherited ​
Displays this element fullscreen.
Other resources ​
- Fullscreen API from MDN.
- Fullscreen specification from W3C.
Inherited from Element.
Implementation
dart
@SupportedBrowser(SupportedBrowser.CHROME)
@SupportedBrowser(SupportedBrowser.FIREFOX)
@SupportedBrowser(SupportedBrowser.SAFARI)
Future<void> requestFullscreen([Map? options]) {
var retValue;
if (options != null) {
retValue = JS(
'',
'(#.requestFullscreen||#.webkitRequestFullscreen).call(#, #)',
this,
this,
this,
convertDartToNative_Dictionary(options),
);
} else {
retValue = JS(
'',
'(#.requestFullscreen||#.webkitRequestFullscreen).call(#)',
this,
this,
this,
);
}
if (retValue != null) return promiseToFuture(retValue);
return Future<void>.value();
}requestPointerLock() inherited ​
void requestPointerLock()Inherited from Element.
Implementation
dart
void requestPointerLock() native;scroll() inherited ​
void scroll([dynamic options_OR_x, num? y])Inherited from Element.
Implementation
dart
void scroll([options_OR_x, num? y]) {
if (options_OR_x == null && y == null) {
_scroll_1();
return;
}
if ((options_OR_x is Map) && y == null) {
var options_1 = convertDartToNative_Dictionary(options_OR_x);
_scroll_2(options_1);
return;
}
if (y != null && (options_OR_x is num)) {
_scroll_3(options_OR_x, y);
return;
}
throw new ArgumentError("Incorrect number or type of arguments");
}scrollBy() inherited ​
void scrollBy([dynamic options_OR_x, num? y])Inherited from Element.
Implementation
dart
void scrollBy([options_OR_x, num? y]) {
if (options_OR_x == null && y == null) {
_scrollBy_1();
return;
}
if ((options_OR_x is Map) && y == null) {
var options_1 = convertDartToNative_Dictionary(options_OR_x);
_scrollBy_2(options_1);
return;
}
if (y != null && (options_OR_x is num)) {
_scrollBy_3(options_OR_x, y);
return;
}
throw new ArgumentError("Incorrect number or type of arguments");
}scrollIntoView() inherited ​
void scrollIntoView([ScrollAlignment? alignment])Scrolls this element into view.
Only one of the alignment options may be specified at a time.
If no options are specified then this will attempt to scroll the minimum amount needed to bring the element into view.
Note that alignCenter is currently only supported on WebKit platforms. If alignCenter is specified but not supported then this will fall back to alignTop.
See also:
- scrollIntoView from MDN.
- scrollIntoViewIfNeeded from MDN.
Inherited from Element.
Implementation
dart
void scrollIntoView([ScrollAlignment? alignment]) {
var hasScrollIntoViewIfNeeded = true;
hasScrollIntoViewIfNeeded = JS(
'bool',
'!!(#.scrollIntoViewIfNeeded)',
this,
);
if (alignment == ScrollAlignment.TOP) {
this._scrollIntoView(true);
} else if (alignment == ScrollAlignment.BOTTOM) {
this._scrollIntoView(false);
} else if (hasScrollIntoViewIfNeeded) {
// TODO(srujzs): This method shouldn't be calling out to
// `scrollIntoViewIfNeeded`. Remove this and make `scrollIntoView` match
// the browser definition. If you intend to use `scrollIntoViewIfNeeded`,
// use the `Element.scrollIntoViewIfNeeded` method.
if (alignment == ScrollAlignment.CENTER) {
this.scrollIntoViewIfNeeded(true);
} else {
this.scrollIntoViewIfNeeded();
}
} else {
this._scrollIntoView();
}
}scrollIntoViewIfNeeded() inherited ​
void scrollIntoViewIfNeeded([bool? centerIfNeeded])Nonstandard version of scrollIntoView that scrolls the current element into the visible area of the browser window if it's not already within the visible area of the browser window. If the element is already within the visible area of the browser window, then no scrolling takes place.
Other resources ​
- Element.scrollIntoViewIfNeeded from MDN.
Inherited from Element.
Implementation
dart
void scrollIntoViewIfNeeded([bool? centerIfNeeded]) native;scrollTo() inherited ​
void scrollTo([dynamic options_OR_x, num? y])Inherited from Element.
Implementation
dart
void scrollTo([options_OR_x, num? y]) {
if (options_OR_x == null && y == null) {
_scrollTo_1();
return;
}
if ((options_OR_x is Map) && y == null) {
var options_1 = convertDartToNative_Dictionary(options_OR_x);
_scrollTo_2(options_1);
return;
}
if (y != null && (options_OR_x is num)) {
_scrollTo_3(options_OR_x, y);
return;
}
throw new ArgumentError("Incorrect number or type of arguments");
}setApplyScroll() inherited ​
Future<ScrollState> setApplyScroll(String nativeScrollBehavior)Inherited from Element.
Implementation
dart
Future<ScrollState> setApplyScroll(String nativeScrollBehavior) {
var completer = new Completer<ScrollState>();
_setApplyScroll((value) {
completer.complete(value);
}, nativeScrollBehavior);
return completer.future;
}setAttribute() inherited ​
Inherited from Element.
Implementation
dart
@pragma('dart2js:tryInline')
void setAttribute(String name, Object value) {
// TODO(41258): Delete these assertions after forcing strong mode.
// Protect [name] against string conversion to "null" or "undefined".
assert(name != null, 'Attribute name cannot be null');
// TODO(sra): assert(value != null, 'Attribute value cannot be null.');
_setAttribute(name, value);
}setAttributeNS() inherited ​
Inherited from Element.
Implementation
dart
@pragma('dart2js:tryInline')
void setAttributeNS(String? namespaceURI, String name, Object value) {
// TODO(41258): Delete these assertions after forcing strong mode.
// Protect [name] against string conversion to "null" or "undefined".
assert(name != null, 'Attribute name cannot be null');
// TODO(sra): assert(value != null, 'Attribute value cannot be null.');
_setAttributeNS(namespaceURI, name, value);
}setDistributeScroll() inherited ​
Future<ScrollState> setDistributeScroll(String nativeScrollBehavior)Inherited from Element.
Implementation
dart
Future<ScrollState> setDistributeScroll(String nativeScrollBehavior) {
var completer = new Completer<ScrollState>();
_setDistributeScroll((value) {
completer.complete(value);
}, nativeScrollBehavior);
return completer.future;
}setInnerHtml() inherited ​
void setInnerHtml(
String? html, {
NodeValidator? validator,
NodeTreeSanitizer? treeSanitizer,
})Parses the HTML fragment and sets it as the contents of this element. This ensures that the generated content follows the sanitization rules specified by the validator or treeSanitizer.
If the default validation behavior is too restrictive then a new NodeValidator should be created, either extending or wrapping a default validator and overriding the validation APIs.
The treeSanitizer is used to walk the generated node tree and sanitize it. A custom treeSanitizer can also be provided to perform special validation rules but since the API is more complex to implement this is discouraged.
The resulting tree is guaranteed to only contain nodes and attributes which are allowed by the provided validator.
See also:
Inherited from Element.
Implementation
dart
void setInnerHtml(
String? html, {
NodeValidator? validator,
NodeTreeSanitizer? treeSanitizer,
}) {
text = null;
if (treeSanitizer is _TrustedHtmlTreeSanitizer) {
_innerHtml = html;
} else {
append(
createFragment(
html,
validator: validator,
treeSanitizer: treeSanitizer,
),
);
}
}setPointerCapture() inherited ​
void setPointerCapture(int pointerId)Inherited from Element.
Implementation
dart
void setPointerCapture(int pointerId) native;toString() override ​
String toString()The string representation of this element.
This is equivalent to reading the localName property.
Implementation
dart
String toString() => JS('String', 'String(#)', this);Operators ​
operator ==() inherited ​
The equality operator.
The default behavior for all Objects is to return true if and only if this object and other are the same object.
Override this method to specify a different equality relation on a class. The overriding method must still be an equivalence relation. That is, it must be:
Total: It must return a boolean for all arguments. It should never throw.
Reflexive: For all objects
o,o == omust be true.Symmetric: For all objects
o1ando2,o1 == o2ando2 == o1must either both be true, or both be false.Transitive: For all objects
o1,o2, ando3, ifo1 == o2ando2 == o3are true, theno1 == o3must be true.
The method should also be consistent over time, so whether two objects are equal should only change if at least one of the objects was modified.
If a subclass overrides the equality operator, it should override the hashCode method as well to maintain consistency.
Inherited from Interceptor.
Implementation
dart
bool operator ==(Object other) => identical(this, other);