Dart API Referencedart:htmlMetaElement

MetaElement class

The meta objects expose the HTMLMetaElement interface which contains descriptive metadata about a document.  This object inherits all of the properties and methods described in the element section.
@DocsEditable
@DomName('HTMLMetaElement')
class MetaElement extends Element native "HTMLMetaElement" {

 @DomName('HTMLMetaElement.content')
 @DocsEditable
 String content;

 @DomName('HTMLMetaElement.httpEquiv')
 @DocsEditable
 String httpEquiv;

 @DomName('HTMLMetaElement.name')
 @DocsEditable
 String name;
}

Extends

Interceptor > EventTarget > Node > Element > MetaElement

Properties

final _NamedNodeMap $dom_attributes #

inherited from Element
All attributes associated with an element.
final _NamedNodeMap $dom_attributes

final int $dom_childElementCount #

inherited from Element
The number of child nodes that are elements.
final int $dom_childElementCount

final List<Node> $dom_childNodes #

inherited from Node
final List<Node> $dom_childNodes

final HtmlCollection $dom_children #

inherited from Element
A live nsIDOMNodeList of the current child elements.
final HtmlCollection $dom_children

String $dom_className #

inherited from Element
Gets/sets the class of the element.
String $dom_className

final Node $dom_firstChild #

inherited from Node
final Node $dom_firstChild

final Element $dom_firstElementChild #

inherited from Element
The first direct child element of an element, or null if the element has no child elements.
final Element $dom_firstElementChild

final Node $dom_lastChild #

inherited from Node
final Node $dom_lastChild

final Element $dom_lastElementChild #

inherited from Element
The last direct child element of an element, or null if the element has no child elements.
final Element $dom_lastElementChild

final String $dom_namespaceUri #

inherited from Node
final String $dom_namespaceUri

Map<String, String> attributes #

inherited from Element

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.

Map<String, String> get attributes => new _ElementAttributeMap(this);
void set attributes(Map<String, String> value) {
 Map<String, String> attributes = this.attributes;
 attributes.clear();
 for (String key in value.keys) {
   attributes[key] = value[key];
 }
}

List<Element> children #

inherited from Element

List of the direct children of this element.

This collection can be used to add and remove elements from the document.

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.
}
List<Element> get children => new _ChildrenElementList._wrap(this);
void set children(List<Element> value) {
 // Copy list first since we don't want liveness during iteration.
 List copy = new List.from(value);
 var children = this.children;
 children.clear();
 children.addAll(copy);
}

CssClassSet classes #

inherited from Element

The set of CSS classes applied to this element.

This set makes it easy to add, remove or toggle the classes applied to this element.

element.classes.add('selected');
element.classes.toggle('isOnline');
element.classes.remove('selected');
CssClassSet get classes => new _ElementCssClassSet(this);
void set classes(Iterable<String> value) {
 CssClassSet classSet = classes;
 classSet.clear();
 classSet.addAll(value);
}

final Rect client #

inherited from Element

Gets the position of this element relative to the client area of the page.

Rect get client => new Rect(clientLeft, clientTop, clientWidth, clientHeight);

final int clientHeight #

inherited from Element
The inner height of an element.
final int clientHeight

final int clientLeft #

inherited from Element
The width of the left border of an element.
final int clientLeft

final int clientTop #

inherited from Element
The width of the top border of an element.
final int clientTop

final int clientWidth #

inherited from Element
The inner width of an element.
final int clientWidth

String content #

Gets the content of this template. This is only supported if isTemplate is true.

docs inherited from Element
String content

String contentEditable #

inherited from Element
Gets/sets whether or not the element is editable.
String contentEditable

Map<String, String> dataset #

inherited from Element

Allows access to all custom data attributes (data-*) set on this element.

The keys for the map must follow these rules:

  • The name must not begin with 'xml'.
  • The name cannot contain a semi-colon (';').
  • The name cannot contain any capital letters.

Any keys from markup will be converted to camel-cased keys in the map.

For example, HTML specified as:

<div data-my-random-value='value'></div>

Would be accessed in Dart as:

var value = element.dataset['myRandomValue'];

See also:

Map<String, String> get dataset =>
 new _DataAttributeMap(attributes);
void set dataset(Map<String, String> value) {
 final data = this.dataset;
 data.clear();
 for (String key in value.keys) {
   data[key] = value[key];
 }
}

String dir #

inherited from Element
Gets/sets the directionality of the element.
String dir

final Document document #

inherited from Node
final Document document

bool draggable #

inherited from Element
bool draggable

String dropzone #

inherited from Element
String dropzone

final int hashCode #

inherited from Interceptor

Get a hash code for this object.

All objects have hash codes. Hash codes are guaranteed to be the same for objects that are equal when compared using the equality operator ==. Other than that there are no guarantees about the hash codes. They will not be consistent between runs and there are no distribution guarantees.

If a subclass overrides hashCode it should override the equality operator as well to maintain consistency.

docs inherited from Object
int get hashCode => Primitives.objectHashCode(this);

bool hidden #

inherited from Element
bool hidden

String httpEquiv #

Gets or sets the name of an HTTP response header to define for a document.
String httpEquiv

String id #

inherited from Element
Gets/sets the id of the element.
String id

String innerHtml #

inherited from Element
Gets/sets the markup of the element's content.
String innerHtml

final Node insertionParent #

inherited from Element
final Node insertionParent

final bool isContentEditable #

inherited from Element
Indicates whether or not the content of the element can be edited. Read only.
final bool isContentEditable

final bool isTemplate #

inherited from Element

Returns true if this node is a template.

A node is a template if tagName is TEMPLATE, or the node has the 'template' attribute and this tag supports attribute form for backwards compatibility with existing HTML parsers. The nodes that can use attribute form are table elments (THEAD, TBODY, TFOOT, TH, TR, TD, CAPTION, COLGROUP and COL) and OPTION.

@Experimental
bool get isTemplate => tagName == 'TEMPLATE' || _isAttributeTemplate;

String lang #

inherited from Element
Gets/sets the language of an element's attributes, text, and element contents.
String lang

final String localName #

inherited from Node
final String localName

var model #

inherited from Element

The data model which is inherited through the tree. This is only supported if isTemplate is true.

Setting this will destructive propagate the value to all descendant nodes, and reinstantiate all of the nodes expanded by this template.

Currently this does not support propagation through Shadow DOMs.

@Experimental
get model => _model;
@Experimental
void set model(value) {
 _ensureTemplate();

 var syntax = TemplateElement.syntax[attributes['syntax']];
 _model = value;
 _Bindings._addBindings(this, model, syntax);
}

String name #

Gets or sets the name of a meta-data property to define for a document.
String name

final Element nextElementSibling #

inherited from Element
The element immediately following the given one in the tree, or null if there's no sibling node.
final Element nextElementSibling

final Node nextNode #

inherited from Node
final Node nextNode

List<Node> nodes #

inherited from Node
List<Node> get nodes {
 return new _ChildNodeListLazy(this);
}
void 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.
 List copy = new List.from(value);
 text = '';
 for (Node node in copy) {
   append(node);
 }
}

final int nodeType #

inherited from Node
final int nodeType

final String nodeValue #

inherited from Node
final String nodeValue

final Rect offset #

inherited from Element

Gets the offset of this element relative to its offsetParent.

Rect get offset => new Rect(offsetLeft, offsetTop, offsetWidth, offsetHeight);

final int offsetHeight #

inherited from Element
The height of an element, relative to the layout.
final int offsetHeight

final int offsetLeft #

inherited from Element
The distance from this element's left border to its offsetParent's left border.
final int offsetLeft

final Element offsetParent #

inherited from Element
The element from which all offset calculations are currently computed.
final Element offsetParent

final int offsetTop #

inherited from Element
The distance from this element's top border to its offsetParent's top border.
final int offsetTop

final int offsetWidth #

inherited from Element
The width of an element, relative to the layout.
final int offsetWidth

final Events on #

inherited from EventTarget

This is an ease-of-use accessor for event streams which should only be used when an explicit accessor is not available.

Events get on => new Events(this);

final Stream<Event> onAbort #

inherited from Element
@DomName('Element.onabort')
@DocsEditable
Stream<Event> get onAbort => abortEvent.forTarget(this);

final Stream<Event> onBeforeCopy #

inherited from Element
@DomName('Element.onbeforecopy')
@DocsEditable
Stream<Event> get onBeforeCopy => beforeCopyEvent.forTarget(this);

final Stream<Event> onBeforeCut #

inherited from Element
@DomName('Element.onbeforecut')
@DocsEditable
Stream<Event> get onBeforeCut => beforeCutEvent.forTarget(this);

final Stream<Event> onBeforePaste #

inherited from Element
@DomName('Element.onbeforepaste')
@DocsEditable
Stream<Event> get onBeforePaste => beforePasteEvent.forTarget(this);

final Stream<Event> onBlur #

inherited from Element
Returns the event handling code for the blur event.
@DomName('Element.onblur')
@DocsEditable
Stream<Event> get onBlur => blurEvent.forTarget(this);

final Stream<Event> onChange #

inherited from Element
Returns the event handling code for the change event.
@DomName('Element.onchange')
@DocsEditable
Stream<Event> get onChange => changeEvent.forTarget(this);

final Stream<MouseEvent> onClick #

inherited from Element
Returns the event handling code for the click event.
@DomName('Element.onclick')
@DocsEditable
Stream<MouseEvent> get onClick => clickEvent.forTarget(this);

final Stream<MouseEvent> onContextMenu #

inherited from Element
Returns the event handling code for the contextmenu event.
@DomName('Element.oncontextmenu')
@DocsEditable
Stream<MouseEvent> get onContextMenu => contextMenuEvent.forTarget(this);

final Stream<Event> onCopy #

inherited from Element
Returns the event handling code for the copy event.
@DomName('Element.oncopy')
@DocsEditable
Stream<Event> get onCopy => copyEvent.forTarget(this);

final Stream<Event> onCut #

inherited from Element
Returns the event handling code for the cut event.
@DomName('Element.oncut')
@DocsEditable
Stream<Event> get onCut => cutEvent.forTarget(this);

final Stream<Event> onDoubleClick #

inherited from Element
Returns the event handling code for the dblclick event.
@DomName('Element.ondblclick')
@DocsEditable
Stream<Event> get onDoubleClick => doubleClickEvent.forTarget(this);

final Stream<MouseEvent> onDrag #

inherited from Element
@DomName('Element.ondrag')
@DocsEditable
Stream<MouseEvent> get onDrag => dragEvent.forTarget(this);

final Stream<MouseEvent> onDragEnd #

inherited from Element
@DomName('Element.ondragend')
@DocsEditable
Stream<MouseEvent> get onDragEnd => dragEndEvent.forTarget(this);

final Stream<MouseEvent> onDragEnter #

inherited from Element
@DomName('Element.ondragenter')
@DocsEditable
Stream<MouseEvent> get onDragEnter => dragEnterEvent.forTarget(this);

final Stream<MouseEvent> onDragLeave #

inherited from Element
@DomName('Element.ondragleave')
@DocsEditable
Stream<MouseEvent> get onDragLeave => dragLeaveEvent.forTarget(this);

final Stream<MouseEvent> onDragOver #

inherited from Element
@DomName('Element.ondragover')
@DocsEditable
Stream<MouseEvent> get onDragOver => dragOverEvent.forTarget(this);

final Stream<MouseEvent> onDragStart #

inherited from Element
@DomName('Element.ondragstart')
@DocsEditable
Stream<MouseEvent> get onDragStart => dragStartEvent.forTarget(this);

final Stream<MouseEvent> onDrop #

inherited from Element
@DomName('Element.ondrop')
@DocsEditable
Stream<MouseEvent> get onDrop => dropEvent.forTarget(this);

final Stream<Event> onError #

inherited from Element
@DomName('Element.onerror')
@DocsEditable
Stream<Event> get onError => errorEvent.forTarget(this);

final Stream<Event> onFocus #

inherited from Element
Returns the event handling code for the focus event.
@DomName('Element.onfocus')
@DocsEditable
Stream<Event> get onFocus => focusEvent.forTarget(this);

final Stream<Event> onFullscreenChange #

inherited from Element
@DomName('Element.onwebkitfullscreenchange')
@DocsEditable
Stream<Event> get onFullscreenChange => fullscreenChangeEvent.forTarget(this);

final Stream<Event> onFullscreenError #

inherited from Element
@DomName('Element.onwebkitfullscreenerror')
@DocsEditable
Stream<Event> get onFullscreenError => fullscreenErrorEvent.forTarget(this);

final Stream<Event> onInput #

inherited from Element
@DomName('Element.oninput')
@DocsEditable
Stream<Event> get onInput => inputEvent.forTarget(this);

final Stream<Event> onInvalid #

inherited from Element
@DomName('Element.oninvalid')
@DocsEditable
Stream<Event> get onInvalid => invalidEvent.forTarget(this);

final Stream<KeyboardEvent> onKeyDown #

inherited from Element
Returns the event handling code for the keydown event.
@DomName('Element.onkeydown')
@DocsEditable
Stream<KeyboardEvent> get onKeyDown => keyDownEvent.forTarget(this);

final Stream<KeyboardEvent> onKeyPress #

inherited from Element
Returns the event handling code for the keypress event.
@DomName('Element.onkeypress')
@DocsEditable
Stream<KeyboardEvent> get onKeyPress => keyPressEvent.forTarget(this);

final Stream<KeyboardEvent> onKeyUp #

inherited from Element
Returns the event handling code for the keyup event.
@DomName('Element.onkeyup')
@DocsEditable
Stream<KeyboardEvent> get onKeyUp => keyUpEvent.forTarget(this);

final Stream<Event> onLoad #

inherited from Element
@DomName('Element.onload')
@DocsEditable
Stream<Event> get onLoad => loadEvent.forTarget(this);

final Stream<MouseEvent> onMouseDown #

inherited from Element
Returns the event handling code for the mousedown event.
@DomName('Element.onmousedown')
@DocsEditable
Stream<MouseEvent> get onMouseDown => mouseDownEvent.forTarget(this);

final Stream<MouseEvent> onMouseMove #

inherited from Element
Returns the event handling code for the mousemove event.
@DomName('Element.onmousemove')
@DocsEditable
Stream<MouseEvent> get onMouseMove => mouseMoveEvent.forTarget(this);

final Stream<MouseEvent> onMouseOut #

inherited from Element
Returns the event handling code for the mouseout event.
@DomName('Element.onmouseout')
@DocsEditable
Stream<MouseEvent> get onMouseOut => mouseOutEvent.forTarget(this);

final Stream<MouseEvent> onMouseOver #

inherited from Element
Returns the event handling code for the mouseover event.
@DomName('Element.onmouseover')
@DocsEditable
Stream<MouseEvent> get onMouseOver => mouseOverEvent.forTarget(this);

final Stream<MouseEvent> onMouseUp #

inherited from Element
Returns the event handling code for the mouseup event.
@DomName('Element.onmouseup')
@DocsEditable
Stream<MouseEvent> get onMouseUp => mouseUpEvent.forTarget(this);

final Stream<WheelEvent> onMouseWheel #

inherited from Element
@DomName('Element.onmousewheel')
@DocsEditable
Stream<WheelEvent> get onMouseWheel => mouseWheelEvent.forTarget(this);

final Stream<Event> onPaste #

inherited from Element
Returns the event handling code for the paste event.
@DomName('Element.onpaste')
@DocsEditable
Stream<Event> get onPaste => pasteEvent.forTarget(this);

final Stream<Event> onReset #

inherited from Element
@DomName('Element.onreset')
@DocsEditable
Stream<Event> get onReset => resetEvent.forTarget(this);

final Stream<Event> onScroll #

inherited from Element
Returns the event handling code for the scroll event.
@DomName('Element.onscroll')
@DocsEditable
Stream<Event> get onScroll => scrollEvent.forTarget(this);

final Stream<Event> onSearch #

inherited from Element
@DomName('Element.onsearch')
@DocsEditable
Stream<Event> get onSearch => searchEvent.forTarget(this);

final Stream<Event> onSelect #

inherited from Element
@DomName('Element.onselect')
@DocsEditable
Stream<Event> get onSelect => selectEvent.forTarget(this);

final Stream<Event> onSelectStart #

inherited from Element
@DomName('Element.onselectstart')
@DocsEditable
Stream<Event> get onSelectStart => selectStartEvent.forTarget(this);

final Stream<Event> onSubmit #

inherited from Element
@DomName('Element.onsubmit')
@DocsEditable
Stream<Event> get onSubmit => submitEvent.forTarget(this);

final Stream<TouchEvent> onTouchCancel #

inherited from Element
@DomName('Element.ontouchcancel')
@DocsEditable
Stream<TouchEvent> get onTouchCancel => touchCancelEvent.forTarget(this);

final Stream<TouchEvent> onTouchEnd #

inherited from Element
@DomName('Element.ontouchend')
@DocsEditable
Stream<TouchEvent> get onTouchEnd => touchEndEvent.forTarget(this);

final Stream<TouchEvent> onTouchEnter #

inherited from Element
@DomName('Element.ontouchenter')
@DocsEditable
Stream<TouchEvent> get onTouchEnter => touchEnterEvent.forTarget(this);

final Stream<TouchEvent> onTouchLeave #

inherited from Element
@DomName('Element.ontouchleave')
@DocsEditable
Stream<TouchEvent> get onTouchLeave => touchLeaveEvent.forTarget(this);

final Stream<TouchEvent> onTouchMove #

inherited from Element
@DomName('Element.ontouchmove')
@DocsEditable
Stream<TouchEvent> get onTouchMove => touchMoveEvent.forTarget(this);

final Stream<TouchEvent> onTouchStart #

inherited from Element
@DomName('Element.ontouchstart')
@DocsEditable
Stream<TouchEvent> get onTouchStart => touchStartEvent.forTarget(this);

final Stream<TransitionEvent> onTransitionEnd #

inherited from Element
@DomName('Element.onwebkitTransitionEnd')
@DocsEditable
@SupportedBrowser(SupportedBrowser.CHROME)
@SupportedBrowser(SupportedBrowser.FIREFOX)
@SupportedBrowser(SupportedBrowser.IE, '10')
@SupportedBrowser(SupportedBrowser.SAFARI)
Stream<TransitionEvent> get onTransitionEnd => transitionEndEvent.forTarget(this);

final String outerHtml #

inherited from Element
Gets the markup of the element including its content. When used as a setter, replaces the element with nodes parsed from the given string.
final String outerHtml

final Element parent #

inherited from Node
final Element parent

final Node parentNode #

inherited from Node
final Node parentNode

final Element previousElementSibling #

inherited from Element
The element immediately preceding the given one in the tree, or null if there is no sibling element.
final Element previousElementSibling

final Node previousNode #

inherited from Node
final Node previousNode

String pseudo #

inherited from Element
String pseudo

final Element ref #

inherited from Element

Gets the template this node refers to. This is only supported if isTemplate is true.

@Experimental
Element get ref {
 _ensureTemplate();

 Element ref = null;
 var refId = attributes['ref'];
 if (refId != null) {
   ref = document.getElementById(refId);
 }

 return ref != null ? ref : _templateInstanceRef;
}

final String regionOverset #

inherited from Element
final String regionOverset

final Type runtimeType #

inherited from Interceptor

A representation of the runtime type of the object.

docs inherited from Object
Type get runtimeType => getRuntimeType(this);

final int scrollHeight #

inherited from Element
The scroll view height of an element.
final int scrollHeight

int scrollLeft #

inherited from Element
Gets/sets the left scroll offset of an element.
int scrollLeft

int scrollTop #

inherited from Element
Gets/sets the top scroll offset of an element.
int scrollTop

final int scrollWidth #

inherited from Element
The scroll view width of an element.
final int scrollWidth

final ShadowRoot shadowRoot #

inherited from Element
final ShadowRoot shadowRoot

bool spellcheck #

inherited from Element
Controls spell-checking (present on all HTML elements)
bool spellcheck

final CssStyleDeclaration style #

inherited from Element
An object representing the declarations of an element's style attributes.
final CssStyleDeclaration style

int tabIndex #

inherited from Element
Gets/sets the position of the element in the tabbing order.
int tabIndex

final String tagName #

inherited from Element
The name of the tag for the given element.
final String tagName

final TemplateInstance templateInstance #

inherited from Node

Gets the template instance that instantiated this node, if any.

@Experimental
TemplateInstance get templateInstance =>
   _templateInstance != null ? _templateInstance :
   (parent != null ? parent.templateInstance : null);

String text #

inherited from Node
String text

String title #

inherited from Element
A string that appears in a popup box when mouse is over the element.
String title

bool translate #

inherited from Element
bool translate

var xtag #

inherited from Element

Experimental support for web components. This field stores a reference to the component implementation. It was inspired by Mozilla's x-tags project. Please note: in the future it may be possible to extend Element from your class, in which case this field will be deprecated.

If xtag has not been set, it will simply return this Element.

get xtag => _xtag != null ? _xtag : this;
void set xtag(Element value) {
 _xtag = value;
}

Operators

bool operator ==(other) #

inherited from Interceptor

The equality operator.

The default behavior for all Objects is to return true if and only if this and other are the same object.

If a subclass overrides the equality operator it should override the hashCode method as well to maintain consistency.

docs inherited from Object
bool operator ==(other) => identical(this, other);

Methods

Node append(Node newChild) #

inherited from Node

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.

@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.
*/
@DomName('Node.appendChild')
@DocsEditable
Node append(Node newChild) native;

void appendHtml(String text) #

inherited from Element

Parses the specified text as HTML and adds the resulting node after the last child of this element.

void appendHtml(String text) {
 this.insertAdjacentHtml('beforeend', text);
}

void appendText(String text) #

inherited from Element

Adds the specified text as a text node after the last child of this element.

void appendText(String text) {
 this.insertAdjacentText('beforeend', text);
}

void bind(String name, model, String path) #

inherited from Element

Binds the attribute name to the path of the model. Path is a String of accessors such as foo.bar.baz.

docs inherited from Node
@Experimental
void bind(String name, model, String path) {
 _bindElement(this, name, model, path);
}

void blur() #

inherited from Element
Removes keyboard focus from the current element.
@DomName('Element.blur')
@DocsEditable
void blur() native;

void click() #

inherited from Element
Simulates a click on the current element.
@DomName('Element.click')
@DocsEditable
void click() native;

Node clone(bool deep) #

inherited from Node
@JSName('cloneNode')
@DomName('Node.cloneNode')
@DocsEditable
Node clone(bool deep) native;

bool contains(Node other) #

inherited from Node
@DomName('Node.contains')
@DocsEditable
bool contains(Node other) native;

DocumentFragment createInstance() #

inherited from Element

Creates an instance of the template. This is only supported if isTemplate is true.

@Experimental
DocumentFragment createInstance() {
 _ensureTemplate();

 var template = ref;
 if (template == null) template = this;

 var instance = _Bindings._createDeepCloneAndDecorateTemplates(
     template.content, attributes['syntax']);

 if (TemplateElement._instanceCreated != null) {
   TemplateElement._instanceCreated.add(instance);
 }
 return instance;
}

ShadowRoot createShadowRoot() #

inherited from Element
@JSName('webkitCreateShadowRoot')
@DomName('Element.webkitCreateShadowRoot')
@DocsEditable
@SupportedBrowser(SupportedBrowser.CHROME, '25')
@Experimental
ShadowRoot createShadowRoot() native;

bool dispatchEvent(Event event) #

inherited from Node
@DomName('Node.dispatchEvent')
@DocsEditable
bool dispatchEvent(Event event) native;

void focus() #

inherited from Element
Gives keyboard focus to the current element.
@DomName('Element.focus')
@DocsEditable
void focus() native;

Rect getBoundingClientRect() #

inherited from Element
@DomName('Element.getBoundingClientRect')
@DocsEditable
Rect getBoundingClientRect() native;

List<Rect> getClientRects() #

inherited from Element
@DomName('Element.getClientRects')
@DocsEditable
@Returns('_ClientRectList')
@Creates('_ClientRectList')
List<Rect> getClientRects() native;

CssStyleDeclaration getComputedStyle([String pseudoElement]) #

inherited from Element

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:

CssStyleDeclaration getComputedStyle([String pseudoElement]) {
 if (pseudoElement == null) {
   pseudoElement = '';
 }
 // TODO(jacobr): last param should be null, see b/5045788
 return window.$dom_getComputedStyle(this, pseudoElement);
}

List<Node> getElementsByClassName(String name) #

inherited from Element
@DomName('Element.getElementsByClassName')
@DocsEditable
@Returns('NodeList')
@Creates('NodeList')
List<Node> getElementsByClassName(String name) native;

Map<String, String> getNamespacedAttributes(String namespace) #

inherited from Element

Gets a map for manipulating the attributes of a particular namespace.

This is primarily useful for SVG attributes such as xref:link.

Map<String, String> getNamespacedAttributes(String namespace) {
 return new _NamespacedAttributeMap(this, namespace);
}

List<Range> getRegionFlowRanges() #

inherited from Element
@JSName('webkitGetRegionFlowRanges')
@DomName('Element.webkitGetRegionFlowRanges')
@DocsEditable
@SupportedBrowser(SupportedBrowser.CHROME)
@SupportedBrowser(SupportedBrowser.SAFARI)
@Experimental
List<Range> getRegionFlowRanges() native;

bool hasChildNodes() #

inherited from Node
@DomName('Node.hasChildNodes')
@DocsEditable
bool hasChildNodes() native;

Element insertAdjacentElement(String where, Element element) #

inherited from Element

Inserts element into the DOM at the specified location.

To see the possible values for where, read the doc for insertAdjacentHtml.

See also:

  • insertAdjacentHtml
Element insertAdjacentElement(String where, Element element) {
 if (JS('bool', '!!#.insertAdjacentElement', this)) {
   _insertAdjacentElement(where, element);
 } else {
   _insertAdjacentNode(where, element);
 }
 return element;
}

void insertAdjacentHtml(String where, String text) #

inherited from Element

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.

    var html = '<div class="something">content</div>'; // Inserts as the first child document.body.insertAdjacentHtml('afterBegin', html); var createdElement = document.body.children0; print(createdElement.classes0); // Prints 'something'

See also:

  • insertAdjacentText
  • insertAdjacentElement
void insertAdjacentHtml(String where, String text) {
 if (JS('bool', '!!#.insertAdjacentHtml', this)) {
   _insertAdjacentHtml(where, text);
 } else {
   _insertAdjacentNode(where, new DocumentFragment.html(text));
 }
}

void insertAdjacentText(String where, String text) #

inherited from Element

Creates a text node and inserts it into the DOM at the specified location.

To see the possible values for where, read the doc for insertAdjacentHtml.

See also:

  • insertAdjacentHtml
void insertAdjacentText(String where, String text) {
 if (JS('bool', '!!#.insertAdjacentText', this)) {
   _insertAdjacentText(where, text);
 } else {
   _insertAdjacentNode(where, new Text(text));
 }
}

Node insertAllBefore(Iterable<Node> newNodes, Node refChild) #

inherited from Node

Inserts all of the nodes into this node directly before refChild.

See also:

  • insertBefore
Node insertAllBefore(Iterable<Node> newNodes, Node refChild) {
 if (newNodes is _ChildNodeListLazy) {
   if (identical(newNodes._this, this)) {
     throw new ArgumentError(newNodes);
   }

   // Optimized route for copying between nodes.
   for (var i = 0, len = newNodes.length; i < len; ++i) {
     // Should use $dom_firstChild, Bug 8886.
     this.insertBefore(newNodes[0], refChild);
   }
 } else {
   for (var node in newNodes) {
     this.insertBefore(node, refChild);
   }
 }
}

Node insertBefore(Node newChild, Node refChild) #

inherited from Node
@DomName('Node.insertBefore')
@DocsEditable
Node insertBefore(Node newChild, Node refChild) native;

bool matches(String selectors) #

inherited from Element

Checks if this element matches the CSS selectors.

@Experimental
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);
 }
 throw new UnsupportedError("Not supported on this platform");
}

dynamic noSuchMethod(Invocation invocation) #

inherited from Interceptor

noSuchMethod is invoked when users invoke a non-existant method on an object. The name of the method and the arguments of the invocation are passed to noSuchMethod in an Invocation. If noSuchMethod returns a value, that value becomes the result of the original invocation.

The default behavior of noSuchMethod is to throw a noSuchMethodError.

docs inherited from Object
dynamic noSuchMethod(Invocation invocation) {
 throw new NoSuchMethodError(
     this,
     _symbolToString(invocation.memberName),
     invocation.positionalArguments,
     _symbolMapToStringMap(invocation.namedArguments));
}

void onCreated() #

inherited from Element

Called by the DOM when this element has been instantiated.

@Experimental
void onCreated() {}

Element query(String selectors) #

inherited from Element

Finds the first descendant element of this element that matches the specified group of selectors.

selectors should be a string using CSS selector syntax.

// Gets the first descendant with the class 'classname'
var element = element.query('.className');
// Gets the element with id 'id'
var element = element.query('#id');
// Gets the first descendant [ImageElement]
var img = element.query('img');

See also:

@JSName('querySelector')
/**
* Finds the first descendant element of this element that matches the
* specified group of selectors.
*
* [selectors] should be a string using CSS selector syntax.
*
*     // Gets the first descendant with the class 'classname'
*     var element = element.query('.className');
*     // Gets the element with id 'id'
*     var element = element.query('#id');
*     // Gets the first descendant [ImageElement]
*     var img = element.query('img');
*
* See also:
*
* * [CSS Selectors](http://docs.webplatform.org/wiki/css/selectors)
*/
@DomName('Element.querySelector')
@DocsEditable
Element query(String selectors) native;

ElementList queryAll(String selectors) #

inherited from Element

Finds all descendent elements of this element that match the specified group of selectors.

selectors should be a string using CSS selector syntax.

var items = element.query('.itemClassName');
ElementList queryAll(String selectors) =>
 new _FrozenElementList._wrap($dom_querySelectorAll(selectors));

void remove() #

inherited from Node

Removes this node from the DOM.

@DomName('Node.removeChild')
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;
   parentNode.$dom_removeChild(this);
 }
}

Node replaceWith(Node otherNode) #

inherited from Node

Replaces this node with another node.

@DomName('Node.replaceChild')
Node replaceWith(Node otherNode) {
 try {
   final Node parent = this.parentNode;
   parent.$dom_replaceChild(otherNode, this);
 } catch (e) {

 };
 return this;
}

void requestFullscreen() #

inherited from Element
@JSName('webkitRequestFullscreen')
@DomName('Element.webkitRequestFullscreen')
@DocsEditable
@SupportedBrowser(SupportedBrowser.CHROME)
@SupportedBrowser(SupportedBrowser.SAFARI)
@Experimental
void requestFullscreen() native;

void requestFullScreen(int flags) #

inherited from Element
Asynchronously asks the browser to make the element full-screen.
@JSName('webkitRequestFullScreen')
@DomName('Element.webkitRequestFullScreen')
@DocsEditable
@SupportedBrowser(SupportedBrowser.CHROME)
@SupportedBrowser(SupportedBrowser.SAFARI)
@Experimental
void requestFullScreen(int flags) native;

void requestPointerLock() #

inherited from Element
@JSName('webkitRequestPointerLock')
@DomName('Element.webkitRequestPointerLock')
@DocsEditable
@SupportedBrowser(SupportedBrowser.CHROME)
@SupportedBrowser(SupportedBrowser.SAFARI)
@Experimental
void requestPointerLock() native;

void scrollByLines(int lines) #

inherited from Element
@DomName('Element.scrollByLines')
@DocsEditable
void scrollByLines(int lines) native;

void scrollByPages(int pages) #

inherited from Element
@DomName('Element.scrollByPages')
@DocsEditable
void scrollByPages(int pages) native;

void scrollIntoView([ScrollAlignment alignment]) #

inherited from Element

Scrolls this element into view.

Only one of 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:

void scrollIntoView([ScrollAlignment alignment]) {
 var hasScrollIntoViewIfNeeded = false;
 hasScrollIntoViewIfNeeded =
     JS('bool', '!!(#.scrollIntoViewIfNeeded)', this);
 if (alignment == ScrollAlignment.TOP) {
   this.$dom_scrollIntoView(true);
 } else if (alignment == ScrollAlignment.BOTTOM) {
   this.$dom_scrollIntoView(false);
 } else if (hasScrollIntoViewIfNeeded) {
   if (alignment == ScrollAlignment.CENTER) {
     this.$dom_scrollIntoViewIfNeeded(true);
   } else {
     this.$dom_scrollIntoViewIfNeeded();
   }
 } else {
   this.$dom_scrollIntoView();
 }
}

String toString() #

inherited from Node

Print out a String representation of this Node.

String toString() => localName == null ?
   (nodeValue == null ? super.toString() : nodeValue) : localName;

void unbind(String name) #

inherited from Element

Unbinds the attribute name.

docs inherited from Node
@Experimental
void unbind(String name) {
 _unbindElement(this, name);
}

void unbindAll() #

inherited from Element

Unbinds all bound attributes.

docs inherited from Node
@Experimental
void unbindAll() {
 _unbindAllElement(this);
}

void $dom_addEventListener(String type, EventListener listener, [bool useCapture]) #

inherited from Node
@JSName('addEventListener')
@DomName('Node.addEventListener')
@DocsEditable
void $dom_addEventListener(String type, EventListener listener, [bool useCapture]) native;

String $dom_getAttribute(String name) #

inherited from Element
Retrieve the value of the named attribute from the current node.
@JSName('getAttribute')
@DomName('Element.getAttribute')
@DocsEditable
String $dom_getAttribute(String name) native;

String $dom_getAttributeNS(String namespaceURI, String localName) #

inherited from Element
Retrieve the value of the attribute with the specified name and namespace, from the current node.
@JSName('getAttributeNS')
@DomName('Element.getAttributeNS')
@DocsEditable
String $dom_getAttributeNS(String namespaceURI, String localName) native;

List<Node> $dom_getElementsByTagName(String name) #

inherited from Element
Retrieve a set of all descendant elements, of a particular tag name, from the current element.
@JSName('getElementsByTagName')
@DomName('Element.getElementsByTagName')
@DocsEditable
@Returns('NodeList')
@Creates('NodeList')
List<Node> $dom_getElementsByTagName(String name) native;

bool $dom_hasAttribute(String name) #

inherited from Element
Check if the element has the specified attribute, or not.
@JSName('hasAttribute')
@DomName('Element.hasAttribute')
@DocsEditable
bool $dom_hasAttribute(String name) native;

bool $dom_hasAttributeNS(String namespaceURI, String localName) #

inherited from Element
Check if the element has the specified attribute, in the specified namespace, or not.
@JSName('hasAttributeNS')
@DomName('Element.hasAttributeNS')
@DocsEditable
bool $dom_hasAttributeNS(String namespaceURI, String localName) native;

List<Node> $dom_querySelectorAll(String selectors) #

inherited from Element
@JSName('querySelectorAll')
@DomName('Element.querySelectorAll')
@DocsEditable
@Returns('NodeList')
@Creates('NodeList')
List<Node> $dom_querySelectorAll(String selectors) native;

void $dom_removeAttribute(String name) #

inherited from Element
Remove the named attribute from the current node.
@JSName('removeAttribute')
@DomName('Element.removeAttribute')
@DocsEditable
void $dom_removeAttribute(String name) native;

void $dom_removeAttributeNS(String namespaceURI, String localName) #

inherited from Element
Remove the attribute with the specified name and namespace, from the current node.
@JSName('removeAttributeNS')
@DomName('Element.removeAttributeNS')
@DocsEditable
void $dom_removeAttributeNS(String namespaceURI, String localName) native;

Node $dom_removeChild(Node oldChild) #

inherited from Node
@JSName('removeChild')
@DomName('Node.removeChild')
@DocsEditable
Node $dom_removeChild(Node oldChild) native;

void $dom_removeEventListener(String type, EventListener listener, [bool useCapture]) #

inherited from Node
@JSName('removeEventListener')
@DomName('Node.removeEventListener')
@DocsEditable
void $dom_removeEventListener(String type, EventListener listener, [bool useCapture]) native;

Node $dom_replaceChild(Node newChild, Node oldChild) #

inherited from Node
@JSName('replaceChild')
@DomName('Node.replaceChild')
@DocsEditable
Node $dom_replaceChild(Node newChild, Node oldChild) native;

void $dom_scrollIntoView([bool alignWithTop]) #

inherited from Element
Scrolls the page until the element gets into the view.
@JSName('scrollIntoView')
@DomName('Element.scrollIntoView')
@DocsEditable
void $dom_scrollIntoView([bool alignWithTop]) native;

void $dom_scrollIntoViewIfNeeded([bool centerIfNeeded]) #

inherited from Element
@JSName('scrollIntoViewIfNeeded')
@DomName('Element.scrollIntoViewIfNeeded')
@DocsEditable
void $dom_scrollIntoViewIfNeeded([bool centerIfNeeded]) native;

void $dom_setAttribute(String name, String value) #

inherited from Element
Set the value of the named attribute from the current node.
@JSName('setAttribute')
@DomName('Element.setAttribute')
@DocsEditable
void $dom_setAttribute(String name, String value) native;

void $dom_setAttributeNS(String namespaceURI, String qualifiedName, String value) #

inherited from Element
Set the value of the attribute with the specified name and namespace, from the current node.
@JSName('setAttributeNS')
@DomName('Element.setAttributeNS')
@DocsEditable
void $dom_setAttributeNS(String namespaceURI, String qualifiedName, String value) native;

This page includes content from the Mozilla Foundation that is graciously licensed under a Creative Commons: Attribution-Sharealike license. Mozilla has no other association with Dart or dartlang.org. We encourage you to improve the web by contributing to The Mozilla Developer Network.