W3cubDocs

/Dart 2

Document class

The base class for all documents.

Each web page loaded in the browser has its own Document object, which is typically an HtmlDocument.

If you aren't comfortable with DOM concepts, see the Dart tutorial Target 2: Connect Dart & HTML.

Inheritance
Implementers
Annotations
  • @Native("Document")

Constructors

Document()
factory

Properties

activeElementElement
final
addressSpaceString
final
contentTypeString
final
currentScriptScriptElement
final
documentElementElement
final
domainString
final
fontsFontFaceSet
final
fullscreenElementElement
final
fullscreenEnabledbool
final
hiddenbool
final
implementationDomImplementation
final
onAbortStream<Event>
read-only
Stream of abort events handled by this Document.
onBeforeCopyStream<Event>
read-only
Stream of beforecopy events handled by this Document.
onBeforeCutStream<Event>
read-only
Stream of beforecut events handled by this Document.
onBeforePasteStream<Event>
read-only
Stream of beforepaste events handled by this Document.
onBlurStream<Event>
read-only
Stream of blur events handled by this Document.
onCanPlayStream<Event>
read-only
onCanPlayThroughStream<Event>
read-only
onChangeStream<Event>
read-only
Stream of change events handled by this Document.
onClickStream<MouseEvent>
read-only
Stream of click events handled by this Document.
onContextMenuStream<MouseEvent>
read-only
Stream of contextmenu events handled by this Document.
onCopyStream<ClipboardEvent>
read-only
Stream of copy events handled by this Document.
onCutStream<ClipboardEvent>
read-only
Stream of cut events handled by this Document.
onDoubleClickStream<Event>
@DomName('Document.ondblclick'), read-only
Stream of doubleclick events handled by this Document.
onDragStream<MouseEvent>
read-only
Stream of drag events handled by this Document.
onDragEndStream<MouseEvent>
read-only
Stream of dragend events handled by this Document.
onDragEnterStream<MouseEvent>
read-only
Stream of dragenter events handled by this Document.
onDragLeaveStream<MouseEvent>
read-only
Stream of dragleave events handled by this Document.
onDragOverStream<MouseEvent>
read-only
Stream of dragover events handled by this Document.
onDragStartStream<MouseEvent>
read-only
Stream of dragstart events handled by this Document.
onDropStream<MouseEvent>
read-only
Stream of drop events handled by this Document.
onDurationChangeStream<Event>
read-only
onEmptiedStream<Event>
read-only
onEndedStream<Event>
read-only
onErrorStream<Event>
read-only
Stream of error events handled by this Document.
onFocusStream<Event>
read-only
Stream of focus events handled by this Document.
onFullscreenChangeStream<Event>
read-only
Stream of fullscreenchange events handled by this Document.
onFullscreenErrorStream<Event>
read-only
Stream of fullscreenerror events handled by this Document.
onInputStream<Event>
read-only
Stream of input events handled by this Document.
onInvalidStream<Event>
read-only
Stream of invalid events handled by this Document.
onKeyDownStream<KeyboardEvent>
read-only
Stream of keydown events handled by this Document.
onKeyPressStream<KeyboardEvent>
read-only
Stream of keypress events handled by this Document.
onKeyUpStream<KeyboardEvent>
read-only
Stream of keyup events handled by this Document.
onLoadStream<Event>
read-only
Stream of load events handled by this Document.
onLoadedDataStream<Event>
read-only
onLoadedMetadataStream<Event>
read-only
onMouseDownStream<MouseEvent>
read-only
Stream of mousedown events handled by this Document.
onMouseEnterStream<MouseEvent>
read-only
Stream of mouseenter events handled by this Document.
onMouseLeaveStream<MouseEvent>
read-only
Stream of mouseleave events handled by this Document.
onMouseMoveStream<MouseEvent>
read-only
Stream of mousemove events handled by this Document.
onMouseOutStream<MouseEvent>
read-only
Stream of mouseout events handled by this Document.
onMouseOverStream<MouseEvent>
read-only
Stream of mouseover events handled by this Document.
onMouseUpStream<MouseEvent>
read-only
Stream of mouseup events handled by this Document.
onMouseWheelStream<WheelEvent>
read-only
Stream of mousewheel events handled by this Document.
onPasteStream<ClipboardEvent>
read-only
Stream of paste events handled by this Document.
onPauseStream<Event>
read-only
onPlayStream<Event>
read-only
onPlayingStream<Event>
read-only
onPointerLockChangeStream<Event>
read-only
onPointerLockErrorStream<Event>
read-only
onRateChangeStream<Event>
read-only
onReadyStateChangeStream<Event>
read-only
Stream of readystatechange events handled by this Document.
onResetStream<Event>
read-only
Stream of reset events handled by this Document.
onResizeStream<Event>
read-only
onScrollStream<Event>
read-only
Stream of scroll events handled by this Document.
onSearchStream<Event>
read-only
Stream of search events handled by this Document.
onSecurityPolicyViolationStream<SecurityPolicyViolationEvent>
read-only
Stream of securitypolicyviolation events handled by this Document.
onSeekedStream<Event>
read-only
onSeekingStream<Event>
read-only
onSelectStream<Event>
read-only
Stream of select events handled by this Document.
onSelectionChangeStream<Event>
read-only
Stream of selectionchange events handled by this Document.
onSelectStartStream<Event>
read-only
Stream of selectstart events handled by this Document.
onStalledStream<Event>
read-only
onSubmitStream<Event>
read-only
Stream of submit events handled by this Document.
onSuspendStream<Event>
read-only
onTimeUpdateStream<Event>
read-only
onTouchCancelStream<TouchEvent>
read-only
Stream of touchcancel events handled by this Document.
onTouchEndStream<TouchEvent>
read-only
Stream of touchend events handled by this Document.
onTouchMoveStream<TouchEvent>
read-only
Stream of touchmove events handled by this Document.
onTouchStartStream<TouchEvent>
read-only
Stream of touchstart events handled by this Document.
onVolumeChangeStream<Event>
read-only
onWaitingStream<Event>
read-only
originString
final
pointerLockElementElement
final
readyStateString
final
rootElementSvgSvgElement
final
rootScrollerElement
read / write
scrollingElementElement
final
suboriginString
final
supportsRegisterbool
read-only
Deprecated: use supportsRegisterElement instead.
supportsRegisterElementbool
read-only
Checks if registerElement is supported on the current platform.
timelineDocumentTimeline
final
visibilityStateString
@SupportedBrowser(SupportedBrowser.CHROME), @SupportedBrowser(SupportedBrowser.FIREFOX), @SupportedBrowser(SupportedBrowser.IE, '10'), read-only
windowWindowBase
read-only
baseUriString
@JSName('baseURI'), final, inherited
childNodesList<Node>
@Creates('NodeList'), @Returns('NodeList'), final, inherited
A list of this node's children. [...]
firstChildNode
final, inherited
The first child of this node. [...]
hashCodeint
read-only, inherited
The hash code for this object. [...]
isConnectedbool
final, inherited
lastChildNode
final, inherited
The last child of this node. [...]
nextNodeNode
@JSName('nextSibling'), final, inherited
The next sibling node. [...]
nodeNameString
final, inherited
The name of this node. [...]
nodesList<Node>
read / write, inherited
A modifiable list of this node's children.
nodeTypeint
final, inherited
The type of node. [...]
nodeValueString
final, inherited
The value of this node. [...]
onEvents
read-only, inherited
This is an ease-of-use accessor for event streams which should only be used when an explicit accessor is not available.
ownerDocumentDocument
final, inherited
The document this node belongs to. [...]
parentElement
@JSName('parentElement'), final, inherited
The parent element of this node. [...]
parentNodeNode
final, inherited
The parent node of this node. [...]
previousNodeNode
@JSName('previousSibling'), final, inherited
The previous sibling node. [...]
runtimeTypeType
read-only, inherited
A representation of the runtime type of the object.
textString
@JSName('textContent'), read / write, inherited
All text within this node and its descendents. [...]

Methods

adoptNode(Node node) → Node
createDocumentFragment() → DocumentFragment
createElement(String tagName, [ String typeExtension ]) → Element
createElementNS(String namespaceURI, String qualifiedName, [ String typeExtension ]) → Element
createRange() → Range
elementsFromPoint(int x, int y) → List<Element>
execCommand(String commandId, [ bool showUI, String value ]) → bool
exitFullscreen() → void
exitPointerLock() → void
getAnimations() → List<Animation>
getElementById(String elementId) → Element
getElementsByClassName(String classNames) → List<Node>
@Creates('NodeList|HtmlCollection'), @Returns('NodeList|HtmlCollection')
getElementsByName(String elementName) → List<Node>
@Creates('NodeList|HtmlCollection'), @Returns('NodeList|HtmlCollection')
getElementsByTagName(String localName) → List<Node>
@Creates('NodeList|HtmlCollection'), @Returns('NodeList|HtmlCollection')
importNode(Node node, [ bool deep ]) → Node
queryCommandEnabled(String commandId) → bool
queryCommandIndeterm(String commandId) → bool
queryCommandState(String commandId) → bool
queryCommandSupported(String commandId) → bool
queryCommandValue(String commandId) → String
querySelector(String selectors) → Element
Finds the first descendant element of this document that matches the specified group of selectors. [...]
querySelectorAll<T extends Element>(String selectors) → ElementList<T>
Finds all descendant elements of this document that match the specified group of selectors. [...]
registerElement(String tag, Type customElementClass, { String extendsTag }) → void
registerElement2(String type, [ Map options ]) → Function
addEventListener(String type, EventListener listener, [ bool useCapture ]) → void
inherited
append(Node node) → Node
@JSName('appendChild'), inherited
Adds a node to the end of the child nodes list of this node. [...]
clone(bool deep) → Node
@JSName('cloneNode'), inherited
Returns a copy of this node. [...]
contains(Node other) → bool
inherited
Returns true if this node contains the specified node. [...]
dispatchEvent(Event event) → bool
inherited
getRootNode([Map options ]) → Node
inherited
hasChildNodes() → bool
inherited
Returns true if this node has any children. [...]
insertAllBefore(Iterable<Node> newNodes, Node refChild) → Node
inherited
Inserts all of the nodes into this node directly before refChild. [...]
insertBefore(Node node, Node child) → Node
inherited
Inserts all of the nodes into this node directly before refChild. [...]
noSuchMethod(Invocation invocation) → dynamic
inherited
Invoked when a non-existent method or property is accessed. [...]
remove() → void
inherited
Removes this node from the DOM.
removeEventListener(String type, EventListener listener, [ bool useCapture ]) → void
inherited
replaceWith(Node otherNode) → Node
inherited
Replaces this node with another node.
toString() → String
inherited
Print out a String representation of this Node.

Operators

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

Constants

pointerLockChangeEvent → const EventStreamProvider<Event>
const EventStreamProvider<Event>('pointerlockchange')
pointerLockErrorEvent → const EventStreamProvider<Event>
const EventStreamProvider<Event>('pointerlockerror')
readyStateChangeEvent → const EventStreamProvider<Event>
Static factory designed to expose readystatechange events to event handlers that are not necessarily instances of Document. [...]
const EventStreamProvider<Event>('readystatechange')
securityPolicyViolationEvent → const EventStreamProvider<SecurityPolicyViolationEvent>
Static factory designed to expose securitypolicyviolation events to event handlers that are not necessarily instances of Document. [...]
const EventStreamProvider<SecurityPolicyViolationEvent>('securitypolicyviolation')
selectionChangeEvent → const EventStreamProvider<Event>
Static factory designed to expose selectionchange events to event handlers that are not necessarily instances of Document. [...]
const EventStreamProvider<Event>('selectionchange')

© 2012 the Dart project authors
Licensed under the Creative Commons Attribution-ShareAlike License v4.0.
https://api.dart.dev/stable/2.5.0/dart-html/Document-class.html