Document class

Inheritance

Constructors

Document()
Document.html(String html)
factory

Properties

attributes LinkedHashMap<Object, String>
A map holding name, value pairs for attributes of the node.
read / writeinherited
attributeSpans LinkedHashMap<Object, FileSpan>?
If sourceSpan is available, this contains the spans of each attribute. The span of an attribute is the entire attribute, including the name and quotes (if any). For example, the span of "attr" in <a attr="value"> would be the text attr="value".
read-onlyinherited
attributeValueSpans LinkedHashMap<Object, FileSpan>?
If sourceSpan is available, this contains the spans of each attribute's value. Unlike attributeSpans, this span will include only the value. For example, the value span of "attr" in <a attr="value"> would be the text value.
read-onlyinherited
body Element?
read-only
children List<Element>
latefinalinherited
documentElement Element?
read-only
firstChild Node?
read-onlyinherited
hashCode int
The hash code for this object.
read-onlyinherited
read-only
nodes NodeList
A list of child nodes of the current node. This must include all elements but not necessarily other node types.
latefinalinherited
nodeType int
read-onlyoverride
outerHtml String
Returns a fragment of HTML or XML that represents the element and its contents.
read-only
parent Element?
The parent element of this node.
read-onlyinherited
parentNode Node?
The parent of the current node (or null for the document node).
read / writeinherited
runtimeType Type
A representation of the runtime type of the object.
read-onlyinherited
sourceSpan FileSpan?
The source span of this node, if it was created by the HtmlParser.
read / writeinherited
text String?
read / writeinherited

Methods

append(Node node) → void
inherited
clone(bool deep) Document
Returns a copy of this node.
override
contains(Node node) bool
inherited
createDocumentFragment() DocumentFragment
createElement(String tag) Element
createElementNS(String? namespaceUri, String? tag) Element
getElementById(String id) Element?
inherited
getElementsByClassName(String classNames) List<Element>
inherited
getElementsByTagName(String localName) List<Element>
inherited
hasChildNodes() bool
inherited
hasContent() bool
Return true if the node has children or text.
inherited
insertBefore(Node node, Node? refNode) → void
Insert node as a child of the current node, before refNode in the
inherited
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
querySelector(String selector) Element?
Seaches for the first descendant node matching the given selectors, using a preorder traversal.
inherited
querySelectorAll(String selector) List<Element>
Returns all descendant nodes matching the given selectors, using a preorder traversal.
inherited
remove() Node
inherited
reparentChildren(Node newParent) → void
Move all the children of the current node to newParent. This is needed so that trees that don't store text as nodes move the text in the correct way.
inherited
replaceWith(Node otherNode) Node
Replaces this node with another node.
inherited
toString() String
A string representation of this object.
override

Operators

operator ==(Object other) bool
The equality operator.
inherited