Document class

The base class for all documents.

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.

Annotations
  • DocsEditable()
  • DomName('Document')
Extends
Implemented by

Constants

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

Instance Properties

activeElement Element
read-only
contentType String
read-only
read / write
currentScript ScriptElement
read-only
window WindowBase
read-only
documentElement Element
read-only
domain String
read-only
fonts FontFaceSet
read-only
fullscreenElement Element
read-only
fullscreenEnabled bool
read-only
hidden bool
read-only
implementation DomImplementation
read-only
pointerLockElement Element
read-only
readyState String
read-only
rootElement SvgSvgElement
read-only
timeline AnimationTimeline
read-only
visibilityState String
read-only
onAbort Stream<Event>
read-only
onBeforeCopy Stream<Event>
read-only
onBeforeCut Stream<Event>
read-only
onBeforePaste Stream<Event>
read-only
onBlur Stream<Event>
read-only
onCanPlay Stream<Event>
read-only
onCanPlayThrough Stream<Event>
read-only
onChange Stream<Event>
read-only
onClick Stream<MouseEvent>
read-only
onContextMenu Stream<MouseEvent>
read-only
onCopy Stream<Event>
read-only
onCut Stream<Event>
read-only
onDoubleClick Stream<Event>
read-only
onDrag Stream<MouseEvent>
read-only
onDragEnd Stream<MouseEvent>
read-only
onDragEnter Stream<MouseEvent>
read-only
onDragLeave Stream<MouseEvent>
read-only
onDragOver Stream<MouseEvent>
read-only
onDragStart Stream<MouseEvent>
read-only
onDrop Stream<MouseEvent>
read-only
onDurationChange Stream<Event>
read-only
onEmptied Stream<Event>
read-only
onEnded Stream<Event>
read-only
onError Stream<Event>
read-only
onFocus Stream<Event>
read-only
onInput Stream<Event>
read-only
onInvalid Stream<Event>
read-only
onKeyDown Stream<KeyboardEvent>
read-only
onKeyPress Stream<KeyboardEvent>
read-only
onKeyUp Stream<KeyboardEvent>
read-only
onLoad Stream<Event>
read-only
onLoadedData Stream<Event>
read-only
onLoadedMetadata Stream<Event>
read-only
onMouseDown Stream<MouseEvent>
read-only
onMouseEnter Stream<MouseEvent>
read-only
onMouseLeave Stream<MouseEvent>
read-only
onMouseMove Stream<MouseEvent>
read-only
onMouseOut Stream<MouseEvent>
read-only
onMouseOver Stream<MouseEvent>
read-only
onMouseUp Stream<MouseEvent>
read-only
onMouseWheel Stream<WheelEvent>
read-only
onPaste Stream<Event>
read-only
onPause Stream<Event>
read-only
onPlay Stream<Event>
read-only
onPlaying Stream<Event>
read-only
onPointerLockChange Stream<Event>
read-only
onPointerLockError Stream<Event>
read-only
onRateChange Stream<Event>
read-only
onReadyStateChange Stream<Event>
read-only
onReset Stream<Event>
read-only
onResize Stream<Event>
read-only
onScroll Stream<Event>
read-only
onSearch Stream<Event>
read-only
onSecurityPolicyViolation Stream<SecurityPolicyViolationEvent>
read-only
onSeeked Stream<Event>
read-only
onSeeking Stream<Event>
read-only
onSelect Stream<Event>
read-only
onSelectionChange Stream<Event>
read-only
onSelectStart Stream<Event>
read-only
onStalled Stream<Event>
read-only
onSubmit Stream<Event>
read-only
onSuspend Stream<Event>
read-only
onTimeUpdate Stream<Event>
read-only
onTouchCancel Stream<TouchEvent>
read-only
onTouchEnd Stream<TouchEvent>
read-only
onTouchMove Stream<TouchEvent>
read-only
onTouchStart Stream<TouchEvent>
read-only
onVolumeChange Stream<Event>
read-only
onWaiting Stream<Event>
read-only
onFullscreenChange Stream<Event>
read-only
onFullscreenError Stream<Event>
read-only
supportsRegisterElement bool
read-only
supportsRegister bool
read-only
on Events Inherited
read-only
nodes List<Node> Inherited
read / write
baseUri String Inherited
read-only
childNodes List<Node> Inherited
read-only
firstChild Node Inherited
read-only
lastChild Node Inherited
read-only
nextNode Node Inherited
read-only
nodeName String Inherited
read-only
nodeType int Inherited
read-only
nodeValue String Inherited
read-only
ownerDocument Document Inherited
read-only
parent Element Inherited
read-only
parentNode Node Inherited
read-only
previousNode Node Inherited
read-only
text String Inherited
read / write

Instance Methods

adoptNode(Node node) → Node
createDocumentFragment() → DocumentFragment
createElementNS(String namespaceURI, String qualifiedName, [String typeExtension]) → Element
createRange() → Range
execCommand(String command, bool userInterface, String value) → bool
exitFullscreen() → void
exitPointerLock() → void
getElementById(String elementId) → Element
getElementsByClassName(String classNames) → List<Node>
getElementsByName(String elementName) → List<Node>
getElementsByTagName(String localName) → List<Node>
importNode(Node node, [bool deep]) → Node
queryCommandEnabled(String command) → bool
queryCommandIndeterm(String command) → bool
queryCommandState(String command) → bool
queryCommandSupported(String command) → bool
queryCommandValue(String command) → String
transformDocumentToTreeView(String noStyleMessage) → void
querySelector(String selectors) → Element
Finds the first descendant element of this document that matches the specified group of selectors.
querySelectorAll(String selectors) → ElementList<Element>
Finds all descendant elements of this document that match the specified group of selectors.
query(String relativeSelectors) → Element
Alias for querySelector. Note this function is deprecated because its semantics will be changing in the future.
queryAll(String relativeSelectors) → ElementList<Element>
Alias for querySelectorAll. Note this function is deprecated because its semantics will be changing in the future.
createElement(String tagName, [String typeExtension]) → Element
toString() → String Inherited
Print out a String representation of this Node.
addEventListener(String type, dynamic listener(Event event), [bool useCapture]) → void Inherited
removeEventListener(String type, dynamic listener(Event event), [bool useCapture]) → void Inherited
dispatchEvent(Event event) → bool Inherited
remove() → void Inherited
Removes this node from the DOM.
replaceWith(Node otherNode) → Node Inherited
Replaces this node with another node.
insertAllBefore(Iterable<Node> newNodes, Node refChild) → Node Inherited
Inserts all of the nodes into this node directly before refChild.
append(Node newChild) → Node Inherited
Adds a node to the end of the child nodes list of this node.
clone(bool deep) → Node Inherited
Returns a copy of this node.
contains(Node other) → bool Inherited
Returns true if this node contains the specified node.
hasChildNodes() → bool Inherited
Returns true if this node has any children.
insertBefore(Node newChild, Node refChild) → Node Inherited
Inserts all of the nodes into this node directly before refChild.