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
-
- Object
- EventTarget
- Node
- Document
- Implementers
- Annotations
-
- @Native("Document")
Constructors
- Document.new()
-
factory
Properties
- activeElement → Element?
-
no setter
- addressSpace → String?
-
no setter
- baseUri → String?
-
no setterinherited
-
childNodes
→ List<
Node> -
A list of this node's children.
no setterinherited
- contentType → String?
-
no setter
-
getter/setter pair
- currentScript → ScriptElement?
-
no setter
- documentElement → Element?
-
no setter
- domain → String?
-
no setter
- firstChild → Node?
-
The first child of this node.
no setterinherited
- fonts → FontFaceSet?
-
no setter
- fullscreenElement → Element?
-
no setter
- fullscreenEnabled → bool?
-
no setter
- hashCode → int
-
The hash code for this object.
no setterinherited
-
no setter
- implementation → DomImplementation?
-
no setter
- isConnected → bool?
-
no setterinherited
- lastChild → Node?
-
The last child of this node.
no setterinherited
- nextNode → Node?
-
The next sibling node.
no setterinherited
- nodeName → String?
-
The name of this node.
no setterinherited
-
nodes
↔ List<
Node> -
A modifiable list of this node's children.
getter/setter pairinherited
- nodeType → int
-
The type of node.
no setterinherited
- nodeValue → String?
-
The value of this node.
no setterinherited
- on → Events
-
This is an ease-of-use accessor for event streams which should only be
used when an explicit accessor is not available.
no setterinherited
-
onAbort
→ Stream<
Event> -
Stream of
abortevents handled by this Document.no setter -
onBeforeCopy
→ Stream<
Event> -
Stream of
beforecopyevents handled by this Document.no setter -
onBeforeCut
→ Stream<
Event> -
Stream of
beforecutevents handled by this Document.no setter -
onBeforePaste
→ Stream<
Event> -
Stream of
beforepasteevents handled by this Document.no setter -
onBlur
→ Stream<
Event> -
Stream of
blurevents handled by this Document.no setter -
onCanPlay
→ Stream<
Event> -
no setter
-
onCanPlayThrough
→ Stream<
Event> -
no setter
-
onChange
→ Stream<
Event> -
Stream of
changeevents handled by this Document.no setter -
onClick
→ Stream<
MouseEvent> -
Stream of
clickevents handled by this Document.no setter -
onContextMenu
→ Stream<
MouseEvent> -
Stream of
contextmenuevents handled by this Document.no setter -
onCopy
→ Stream<
ClipboardEvent> -
Stream of
copyevents handled by this Document.no setter -
onCut
→ Stream<
ClipboardEvent> -
Stream of
cutevents handled by this Document.no setter -
onDoubleClick
→ Stream<
Event> -
Stream of
doubleclickevents handled by this Document.no setter -
onDrag
→ Stream<
MouseEvent> -
Stream of
dragevents handled by this Document.no setter -
onDragEnd
→ Stream<
MouseEvent> -
Stream of
dragendevents handled by this Document.no setter -
onDragEnter
→ Stream<
MouseEvent> -
Stream of
dragenterevents handled by this Document.no setter -
onDragLeave
→ Stream<
MouseEvent> -
Stream of
dragleaveevents handled by this Document.no setter -
onDragOver
→ Stream<
MouseEvent> -
Stream of
dragoverevents handled by this Document.no setter -
onDragStart
→ Stream<
MouseEvent> -
Stream of
dragstartevents handled by this Document.no setter -
onDrop
→ Stream<
MouseEvent> -
Stream of
dropevents handled by this Document.no setter -
onDurationChange
→ Stream<
Event> -
no setter
-
onEmptied
→ Stream<
Event> -
no setter
-
onEnded
→ Stream<
Event> -
no setter
-
onError
→ Stream<
Event> -
Stream of
errorevents handled by this Document.no setter -
onFocus
→ Stream<
Event> -
Stream of
focusevents handled by this Document.no setter -
onFullscreenChange
→ Stream<
Event> -
Stream of
fullscreenchangeevents handled by this Document.no setter -
onFullscreenError
→ Stream<
Event> -
Stream of
fullscreenerrorevents handled by this Document.no setter -
onInput
→ Stream<
Event> -
Stream of
inputevents handled by this Document.no setter -
onInvalid
→ Stream<
Event> -
Stream of
invalidevents handled by this Document.no setter -
onKeyDown
→ Stream<
KeyboardEvent> -
Stream of
keydownevents handled by this Document.no setter -
onKeyPress
→ Stream<
KeyboardEvent> -
Stream of
keypressevents handled by this Document.no setter -
onKeyUp
→ Stream<
KeyboardEvent> -
Stream of
keyupevents handled by this Document.no setter -
onLoad
→ Stream<
Event> -
Stream of
loadevents handled by this Document.no setter -
onLoadedData
→ Stream<
Event> -
no setter
-
onLoadedMetadata
→ Stream<
Event> -
no setter
-
onMouseDown
→ Stream<
MouseEvent> -
Stream of
mousedownevents handled by this Document.no setter -
onMouseEnter
→ Stream<
MouseEvent> -
Stream of
mouseenterevents handled by this Document.no setter -
onMouseLeave
→ Stream<
MouseEvent> -
Stream of
mouseleaveevents handled by this Document.no setter -
onMouseMove
→ Stream<
MouseEvent> -
Stream of
mousemoveevents handled by this Document.no setter -
onMouseOut
→ Stream<
MouseEvent> -
Stream of
mouseoutevents handled by this Document.no setter -
onMouseOver
→ Stream<
MouseEvent> -
Stream of
mouseoverevents handled by this Document.no setter -
onMouseUp
→ Stream<
MouseEvent> -
Stream of
mouseupevents handled by this Document.no setter -
onMouseWheel
→ Stream<
WheelEvent> -
Stream of
mousewheelevents handled by this Document.no setter -
onPaste
→ Stream<
ClipboardEvent> -
Stream of
pasteevents handled by this Document.no setter -
onPause
→ Stream<
Event> -
no setter
-
onPlay
→ Stream<
Event> -
no setter
-
onPlaying
→ Stream<
Event> -
no setter
-
onPointerLockChange
→ Stream<
Event> -
no setter
-
onPointerLockError
→ Stream<
Event> -
no setter
-
onRateChange
→ Stream<
Event> -
no setter
-
onReadyStateChange
→ Stream<
Event> -
Stream of
readystatechangeevents handled by this Document.no setter -
onReset
→ Stream<
Event> -
Stream of
resetevents handled by this Document.no setter -
onResize
→ Stream<
Event> -
no setter
-
onScroll
→ Stream<
Event> -
Stream of
scrollevents handled by this Document.no setter -
onSearch
→ Stream<
Event> -
Stream of
searchevents handled by this Document.no setter -
onSecurityPolicyViolation
→ Stream<
SecurityPolicyViolationEvent> -
Stream of
securitypolicyviolationevents handled by this Document.no setter -
onSeeked
→ Stream<
Event> -
no setter
-
onSeeking
→ Stream<
Event> -
no setter
-
onSelect
→ Stream<
Event> -
Stream of
selectevents handled by this Document.no setter -
onSelectionChange
→ Stream<
Event> -
Stream of
selectionchangeevents handled by this Document.no setter -
onSelectStart
→ Stream<
Event> -
Stream of
selectstartevents handled by this Document.no setter -
onStalled
→ Stream<
Event> -
no setter
-
onSubmit
→ Stream<
Event> -
Stream of
submitevents handled by this Document.no setter -
onSuspend
→ Stream<
Event> -
no setter
-
onTimeUpdate
→ Stream<
Event> -
no setter
-
onTouchCancel
→ Stream<
TouchEvent> -
Stream of
touchcancelevents handled by this Document.no setter -
onTouchEnd
→ Stream<
TouchEvent> -
Stream of
touchendevents handled by this Document.no setter -
onTouchMove
→ Stream<
TouchEvent> -
Stream of
touchmoveevents handled by this Document.no setter -
onTouchStart
→ Stream<
TouchEvent> -
Stream of
touchstartevents handled by this Document.no setter -
onVolumeChange
→ Stream<
Event> -
no setter
-
onWaiting
→ Stream<
Event> -
no setter
- origin → String?
-
no setter
- ownerDocument → Document?
-
The document this node belongs to.
no setterinherited
- parent → Element?
-
The parent element of this node.
no setterinherited
- parentNode → Node?
-
The parent node of this node.
no setterinherited
- pointerLockElement → Element?
-
no setter
- previousNode → Node?
-
The previous sibling node.
no setterinherited
- readyState → String?
-
no setter
- rootElement → SvgSvgElement?
-
no setter
- rootScroller ↔ Element?
-
getter/setter pair
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- scrollingElement → Element?
-
no setter
- suborigin → String?
-
no setter
- text ↔ String?
-
All text within this node and its descendants.
getter/setter pairinherited
- timeline → DocumentTimeline?
-
no setter
- visibilityState → String
-
no setter
- window → WindowBase?
-
no setter
Methods
-
addEventListener(
String type, EventListener? listener, [bool? useCapture]) → void -
inherited
-
adoptNode(
Node node) → Node -
append(
Node node) → Node -
Adds a node to the end of the child nodes list of this node.
inherited
-
clone(
bool? deep) → Node -
Returns a copy of this node.
inherited
-
contains(
Node? other) → bool -
Returns true if this node contains the specified node.
inherited
-
createDocumentFragment(
) → DocumentFragment -
createElement(
String tagName, [String? typeExtension]) → Element -
createElementNS(
String namespaceURI, String qualifiedName, [String? typeExtension]) → Element -
createRange(
) → Range -
dispatchEvent(
Event event) → bool -
inherited
-
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> -
getElementsByName(
String elementName) → List< Node> -
getElementsByTagName(
String localName) → List< Node> -
getRootNode(
[Map? options]) → Node -
inherited
-
hasChildNodes(
) → bool -
Returns true if this node has any children.
inherited
-
importNode(
Node node, [bool? deep]) → Node -
insertAllBefore(
Iterable< Node> newNodes, Node child) → void -
Inserts all of the nodes into this node directly before child.
inherited
-
insertBefore(
Node node, Node? child) → Node -
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.inherited -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
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.
-
remove(
) → void -
Removes this node from the DOM.
inherited
-
removeEventListener(
String type, EventListener? listener, [bool? useCapture]) → void -
inherited
-
replaceWith(
Node otherNode) → Node -
Replaces this node with another node.
inherited
-
toString(
) → String -
Print out a String representation of this Node.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited
Constants
-
pointerLockChangeEvent
→ const EventStreamProvider<
Event> -
pointerLockErrorEvent
→ const EventStreamProvider<
Event> -
readyStateChangeEvent
→ const EventStreamProvider<
Event> -
Static factory designed to expose
readystatechangeevents to event handlers that are not necessarily instances of Document. -
securityPolicyViolationEvent
→ const EventStreamProvider<
SecurityPolicyViolationEvent> -
Static factory designed to expose
securitypolicyviolationevents to event handlers that are not necessarily instances of Document. -
selectionChangeEvent
→ const EventStreamProvider<
Event> -
Static factory designed to expose
selectionchangeevents to event handlers that are not necessarily instances of Document.