From 018440e918b59633eb0a6b9033528f612f84aa49 Mon Sep 17 00:00:00 2001
From: Anne van Kesteren The root of an object is itself, if its
+parent is null, or else it is the root of its parent. The
+root of a tree is any object participating in that
+tree whose parent is null.
An object A is called a
descendant of an object
@@ -1430,6 +1430,27 @@ A node is considered
length is zero.
+ A document tree is a node tree whose
+root is a document.
+
+ The document element of a document is the element whose
+parent is that document, if it exists, and null otherwise.
+
+ Per the node tree constraints, there can be only one such
+element.
+
+ An element is in a document if its root is a
+document.
+
+
+ A shadow tree is a node tree whose root is
+a shadow root.
+
+
In shadow-including tree order, is
-shadow-including preorder, depth-first traversal of a tree.
-shadow-including preorder, depth-first traversal of a tree
+shadow-including preorder, depth-first traversal of a node tree.
+shadow-including preorder, depth-first traversal of a node tree
tree is preorder, depth-first traversal of tree, with for each
-element element encountered in tree, whose
-shadow root is non-null, shadow-including preorder, depth-first traversal
-of the element's shadow root's tree just after it is
+element element encountered in tree with a non-null
+shadow root, shadow-including preorder, depth-first traversal of that
+element's shadow root's node tree just after it is
encountered.
An object A is a
@@ -5361,18 +5382,6 @@ A node's
parent of a different type, its
parent element is null.
-The document element of a
-document is the
-element whose
-parent is that
-document, if it exists, and null otherwise.
-
- Per the node tree constraints, there can only be one
-such element.
-
- An element is in a document if its root is a
-document.
-
An object that participates in
a tree has a parent, which is either another object
or null, and an ordered list of zero or more child objects. An object A whose parent is object B is a child of B. The root of an object is itself, if its parent is null, or else it is the root of its parent. The root of an object is itself, if its parent is null, or else it is the root of its parent. The root of a tree is any object participating in that tree whose parent is null. An object A is called a descendant of an object B, if either A is a child of B or A is a child of an
object C that is a descendant of B. An inclusive descendant is
@@ -1013,7 +1015,15 @@ A node is considered empty if its length is zero. A document tree is a node tree whose root is a document. The document element of a document is the element whose parent is that document, if it exists, and null otherwise. Per the node tree constraints, there can be only one such element. An element is in a document if its root is a document. A shadow tree is a node tree whose root is
+a shadow root. To ensure pre-insertion validity of a node into a parent before a child, run these steps: The Document tree
+
+Shadow tree
+
+Mutation algorithms
To ensure pre-insertion validity
@@ -4999,12 +5020,12 @@ interface ShadowRoot : DocumentFragment {
diff --git a/dom.html b/dom.html
index 8a762be29..62b9e9771 100644
--- a/dom.html
+++ b/dom.html
@@ -127,18 +127,20 @@
Table of Contents
-
NonElementParentNode
- DocumentOrShadowRoot
- ParentNode
- NonDocumentTypeChildNode
- ChildNode
- Elements
+ NonElementParentNode
+ DocumentOrShadowRoot
+ ParentNode
+ NonDocumentTypeChildNode
+ ChildNode
+ Elements
NodeList
and HTMLCollection
+ 4.2.10 Old-style collections: NodeList
and HTMLCollection
2.1.
Its number of children.
4.2.1. Mutation algorithms
+ 4.2.1. Document tree
+ 4.2.2. Shadow tree
+ 4.2.3. Mutation algorithms
- Document
, DocumentFragment
, or Element
node, throw a HierarchyRequestError
.
@@ -1172,7 +1182,7 @@ If suppress observers flag is unset, queue a mutation record of "
childList
" for parent with removedNodes a list solely containing node,
nextSibling oldNextSibling, and previousSibling oldPreviousSibling.
4.2.2. Mixin
+ NonElementParentNode
4.2.4. Mixin
NonElementParentNode
getElementById()
method is not on elements for compatibility with older versions of jQuery. If a time comes where that
version of jQuery has disappeared, we might be able to support it. [NoInterfaceObject,
@@ -1190,7 +1200,7 @@
getElementById(elementId)
method, when invoked, must return the first element, in tree order, within context object’s descendants, whose ID is elementId, and null if
there is no such element otherwise.
DocumentOrShadowRoot
DocumentOrShadowRoot
[NoInterfaceObject, Exposed=Window] interface DocumentOrShadowRoot { @@ -1200,7 +1210,7 @@<
The DocumentOrShadowRoot
mixin is expected to be used by other
standards that want to define APIs shared between documents and shadow roots.
ParentNode
ParentNode
To convert nodes into a node, run these steps:
querySelector(selectors)
method, when invoked, must return the first result of running scope-match a selectors string selectors against the context object, and null if the result is an empty list otherwise.
The querySelectorAll(selectors)
method, when invoked, must return the static result of
running scope-match a selectors string selectors against the context object.
NonDocumentTypeChildNode
NonDocumentTypeChildNode
The previousElementSibling
and nextElementSibling
attributes have
been removed from DocumentType
nodes for compatibility reasons. If these additions are deemed
compatible enough in the future, they could be reinstated.
ChildNode
ChildNode
[NoInterfaceObject, Exposed=Window] interface ChildNode { @@ -1398,7 +1408,7 @@
Remove the context object from context object’s parent.
Elements
Elements
class Elements extends Array { Element? query(DOMString relativeSelectors); Elements queryAll(DOMString relativeSelectors); @@ -1420,7 +1430,7 @@
The
query(relativeSelectors)
method, when invoked, must return the first result of running match a relative selectors string relativeSelectors against the context object, and null if the result is an empty list.The
-queryAll(relativeSelectors)
method, when invoked, must return the result of runningthis.constructor
with the result of running match a relative selectors string relativeSelectors against the context object.4.2.8. Old-style collections:
+NodeList
andHTMLCollection
4.2.10. Old-style collections:
NodeList
andHTMLCollection
A collection is an object that represents a lists of DOM nodes. A collection can be either live or static. Unless otherwise stated, a collection must be live.
@@ -1432,7 +1442,7 @@The collection then represents a view of the subtree rooted at the collection’s root, containing only nodes that match the given filter. The view is linear. In the absence of specific requirements to the contrary, the nodes within the collection must be sorted in tree order. -
4.2.8.1. Interface
+NodeList
4.2.10.1. Interface
NodeList
A
NodeList
object is a collection of nodes.[Exposed=Window] interface NodeList { @@ -1457,7 +1467,7 @@indexth node in the collection. If there is no indexth node in the collection, then the method must return null. -
4.2.8.2. Interface
+HTMLCollection
4.2.10.2. Interface
HTMLCollection
[Exposed=Window, LegacyUnenumerableNamedProperties] interface HTMLCollection { readonly attribute unsigned long length; @@ -2779,7 +2789,7 @@Shadow roots have an associated encapsulation mode ("
open
" or "closed
").The
host
attribute’s getter must return the context object’s host.
-In shadow-including tree order, is shadow-including preorder, depth-first traversal of a tree. shadow-including preorder, depth-first traversal of a tree tree is preorder, depth-first traversal of tree, with for each element element encountered in tree, whose shadow root is non-null, shadow-including preorder, depth-first traversal of the element’s shadow root’s tree just after it is +
In shadow-including tree order, is shadow-including preorder, depth-first traversal of a node tree. shadow-including preorder, depth-first traversal of a node tree tree is preorder, depth-first traversal of tree, with for each element element encountered in tree with a non-null shadow root, shadow-including preorder, depth-first traversal of that element’s shadow root’s node tree just after it is encountered.
An object A is a shadow-including descendant of an object B, if A is a descendant of B, or A’s root is a shadow root and A’s root’s host is a shadow-including inclusive descendant of B.
A shadow-including inclusive descendant is an object or one of its shadow-including descendants.
@@ -2957,10 +2967,6 @@
A node’s parent of type
-Element
is known as a parent element. If the node has a parent of a different type, its parent element is null.The document element of a document is the element whose parent is that document, if it exists, and null otherwise.
-Per the node tree constraints, there can only be one -such element.
-An element is in a document if its root is a document.
- namespace = element .
namespaceURI
@@ -4795,15 +4801,15 @@adopting steps, in §4.5
- adoptNode(node), in §4.5
- after, in §5.2 -
- after(nodes), in §4.2.6 -
- after(nodes...), in §4.2.6 +
- after(nodes), in §4.2.8 +
- after(nodes...), in §4.2.8
- ancestor, in §2.1 -
- append, in §4.2.1 +
- append, in §4.2.3
- append an attribute, in §4.9
- appendChild(node), in §4.4
- appendData(data), in §4.10 -
- append(nodes), in §4.2.4 -
- append(nodes...), in §4.2.4 +
- append(nodes), in §4.2.6 +
- append(nodes...), in §4.2.6
- ASCII case-insensitive, in §2.2
- ASCII case-insensitively, in §2.2
- attachShadow(init), in §4.9 @@ -4835,8 +4841,8 @@
baseURI, in §4.4
- base URL, in §4.5
- before, in §5.2 -
- before(nodes), in §4.2.6 -
- before(nodes...), in §4.2.6 +
- before(nodes), in §4.2.8 +
- before(nodes...), in §4.2.8
- boundary point, in §5.2
- bubbles @@ -4866,15 +4872,15 @@
characterSet, in §4.5
- charset, in §4.5
- child, in §2.1 -
- childElementCount, in §4.2.4 +
- childElementCount, in §4.2.6
- childList, in §4.3.1 -
- ChildNode, in §4.2.6 +
- ChildNode, in §4.2.8
- childNodes, in §4.4
- children
- dfn for tree, in §2.1 -
- attribute for ParentNode, in §4.2.4 +
- attribute for ParentNode, in §4.2.6
- class, in §4.9
- classList, in §4.9 @@ -4892,7 +4898,7 @@
collapsed, in §5.2
- collapse(toStart), in §5.2
- collect a code point sequence, in §2.3 -
- collection, in §4.2.8 +
- collection, in §4.2.10
- Comment, in §4.13
- Comment(data), in §4.13
- COMMENT_NODE, in §4.4 @@ -4911,7 +4917,7 @@
contiguous Text nodes, in §4.11
- converted to ASCII lowercase, in §2.2
- converted to ASCII uppercase, in §2.2 -
- converting nodes into a node, in §4.2.4 +
- converting nodes into a node, in §4.2.6
- createAttribute(localName), in §4.5
- createAttributeNS(namespace, qualifiedName), in §4.5
- createCDATASection(), in §8.2 @@ -4977,18 +4983,19 @@
Document, in §4.5
- document, in §4.5
- documentElement, in §4.5 -
- document element, in §4.9 +
- document element, in §4.2.1
- DocumentFragment, in §4.7
- DocumentFragment(), in §4.7
- DOCUMENT_FRAGMENT_NODE, in §4.4
- DOCUMENT_NODE, in §4.4 -
- DocumentOrShadowRoot, in §4.2.3 +
- DocumentOrShadowRoot, in §4.2.5
- DOCUMENT_POSITION_CONTAINED_BY, in §4.4
- DOCUMENT_POSITION_CONTAINS, in §4.4
- DOCUMENT_POSITION_DISCONNECTED, in §4.4
- DOCUMENT_POSITION_FOLLOWING, in §4.4
- DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC, in §4.4
- DOCUMENT_POSITION_PRECEDING, in §4.4 +
- document tree, in §4.2.1
- DocumentType, in §4.6
- DOCUMENT_TYPE_NODE, in §4.4
- documentURI, in §4.5 @@ -5014,7 +5021,7 @@
Element, in §4.9
- element interface, in §4.5
- ELEMENT_NODE, in §4.4 -
- Elements, in §4.2.7 +
- Elements, in §4.2.9
- empty, in §4.2
- encapsulation mode, in §4.8
- encoding, in §4.5 @@ -5025,7 +5032,7 @@
endOffset, in §5.2
- END_TO_END, in §5.2
- END_TO_START, in §5.2 -
- ensure pre-insertion validity, in §4.2.1 +
- ensure pre-insertion validity, in §4.2.3
- entities, in §8.2
- Entity, in §8.2
- ENTITY_NODE, in §4.4 @@ -5062,7 +5069,7 @@
firstChild(), in §6.2
- firstChild, in §4.4
- first child, in §2.1 -
- firstElementChild, in §4.2.4 +
- firstElementChild, in §4.2.6
- flatten, in §3.6
- following, in §2.1
- get an attribute by name, in §4.9 @@ -5072,7 +5079,7 @@
getAttributeNode(qualifiedName), in §4.9
- getAttributeNS(namespace, localName), in §4.9
- getAttribute(qualifiedName), in §4.9 -
- getElementById(elementId), in §4.2.2 +
- getElementById(elementId), in §4.2.4
- getElementsByClassName(classNames)
@@ -5120,7 +5127,7 @@
attribute for ShadowRoot, in §4.8
- host-including inclusive ancestor, in §4.7 -
- HTMLCollection, in §4.2.8.2 +
- HTMLCollection, in §4.2.10.2
- HTML document, in §4.5
- HTML namespace, in §2.5
- id, in §4.9 @@ -5128,7 +5135,7 @@
implementation, in §4.5
- importNode(node), in §4.5
- importNode(node, deep), in §4.5 -
- in a document, in §4.9 +
- in a document, in §4.2.1
- inclusive ancestor, in §2.1
- inclusive descendant, in §2.1
- inclusive sibling, in §2.1 @@ -5143,7 +5150,7 @@
dfn for Node, in §4.2.1 +
- dfn for Node, in §4.2.3
- dfn for Range, in §5.2
- insert adjacent, in §4.9 @@ -5151,7 +5158,7 @@
insertAdjacentText(where, data), in §4.9
- insertBefore(node, child), in §4.4
- insertData(offset, data), in §4.10 -
- insertion steps, in §4.2.1 +
- insertion steps, in §4.2.3
- insertNode(node), in §5.2
- internalSubset, in §8.2
- intersectsNode(node), in §5.2 @@ -5166,8 +5173,8 @@
method for NodeList, in §4.2.8.1 -
- method for HTMLCollection, in §4.2.8.2 +
- method for NodeList, in §4.2.10.1 +
- method for HTMLCollection, in §4.2.10.2
- method for NamedNodeMap, in §4.9.1
- method for DOMTokenList, in §7.1 @@ -5175,13 +5182,13 @@
last child, in §2.1
- lastChild(), in §6.2
- lastChild, in §4.4 -
- lastElementChild, in §4.2.4 +
- lastElementChild, in §4.2.6
- length
-
- dfn for Node, in §4.2 -
- attribute for NodeList, in §4.2.8.1 -
- attribute for HTMLCollection, in §4.2.8.2 +
- attribute for NodeList, in §4.2.10.1 +
- attribute for HTMLCollection, in §4.2.10.2
- attribute for NamedNodeMap, in §4.9.1
- attribute for CharacterData, in §4.10
- attribute for DOMTokenList, in §7.1 @@ -5191,8 +5198,8 @@
list of elements with namespace namespace and local name localName, in §4.4
- list of elements with qualified name qualifiedName, in §4.4 -
- live, in §4.2.8 -
- live collection, in §4.2.8 +
- live, in §4.2.10 +
- live collection, in §4.2.10
- localName
@@ -5235,7 +5242,7 @@
attribute for Attr, in §4.9.2
- named attribute, in §4.9.2 -
- namedItem(name), in §4.2.8.2 +
- namedItem(name), in §4.2.10.2
- NamedNodeMap, in §4.9.1
- NameList, in §8.2
- @@ -5257,7 +5264,7 @@
attribute for Attr, in §4.9.2
- attribute for Node, in §8.2
- nextElementSibling, in §4.2.5 +
- nextElementSibling, in §4.2.7
- nextNode()
@@ -5277,7 +5284,7 @@
NodeFilter, in §6.3
- NodeIterator, in §6.1
- NodeIterator pre-removing steps, in §6.1 -
- NodeList, in §4.2.8.1 +
- NodeList, in §4.2.10.1
- nodeName
@@ -5293,9 +5300,9 @@
-attribute for Node, in §4.4
- attribute for Attr, in §4.9.2
- NonDocumentTypeChildNode, in §4.2.5 +
- NonDocumentTypeChildNode, in §4.2.7
- NONE, in §3.2 -
- NonElementParentNode, in §4.2.2 +
- NonElementParentNode, in §4.2.4
- no-quirks mode, in §4.5
- normalize(), in §4.4
- normalizeDocument(), in §8.2 @@ -5316,7 +5323,7 @@
parentElement, in §4.4
- parent element, in §4.9
- parentNode, in §4.4 -
- ParentNode, in §4.2.4 +
- ParentNode, in §4.2.6
- parentNode(), in §6.2
- partially contained, in §5.2
- participate, in §2.1 @@ -5332,12 +5339,12 @@
attribute for Node, in §8.2
- prefix match, in §2.2 -
- pre-insert, in §4.2.1 -
- prepend(nodes...), in §4.2.4 -
- prepend(nodes), in §4.2.4 -
- pre-remove, in §4.2.1 +
- pre-insert, in §4.2.3 +
- prepend(nodes...), in §4.2.6 +
- prepend(nodes), in §4.2.6 +
- pre-remove, in §4.2.3
- preventDefault(), in §3.2 -
- previousElementSibling, in §4.2.5 +
- previousElementSibling, in §4.2.7
- previousNode()
@@ -5362,22 +5369,22 @@
-dfn for Element, in §4.9
- dfn for Attr, in §4.9.2
- queryAll(DOMString relativeSelectors), in §4.2.7 +
- queryAll(DOMString relativeSelectors), in §4.2.9
- queryAll(relativeSelectors)
-
-- method for ParentNode, in §4.2.4 -
- method for Elements, in §4.2.7 +
- method for ParentNode, in §4.2.6 +
- method for Elements, in §4.2.9
- query(DOMString relativeSelectors), in §4.2.7 +
- query(DOMString relativeSelectors), in §4.2.9
- query(relativeSelectors)
-
-- method for ParentNode, in §4.2.4 -
- method for Elements, in §4.2.7 +
- method for ParentNode, in §4.2.6 +
- method for Elements, in §4.2.9
- querySelectorAll(selectors), in §4.2.4 -
- querySelector(selectors), in §4.2.4 +
- querySelectorAll(selectors), in §4.2.6 +
- querySelector(selectors), in §4.2.6
- queue a mutation observer compound microtask, in §4.3
- queue a mutation record, in §4.3.2
- quirks mode, in §4.5 @@ -5392,10 +5399,10 @@
method for ChildNode, in §4.2.6 +
- method for ChildNode, in §4.2.8
- method for DOMTokenList, in §7.1 -
- remove, in §4.2.1 +
- remove, in §4.2.3
- remove an attribute, in §4.9
- remove an attribute by name, in §4.9
- remove an attribute by namespace and local name, in §4.9 @@ -5409,19 +5416,19 @@
removeNamedItemNS(namespace, localName), in §4.9.1
- removeNamedItem(qualifiedName), in §4.9.1
- remove(tokens), in §7.1 -
- removing steps, in §4.2.1 +
- removing steps, in §4.2.3
- renameNode(), in §8.2 -
- replace, in §4.2.1 -
- replace all, in §4.2.1 +
- replace, in §4.2.3 +
- replace all, in §4.2.3
- replace an attribute, in §4.9
- replaceChild(node, child), in §4.4
- replace data, in §4.10
- replaceData(offset, count, data), in §4.10
- replace(token, newToken), in §7.1
- replaceWholeText(), in §8.2 -
- replaceWith(nodes...), in §4.2.6 -
- replaceWith(nodes), in §4.2.6 -
- represented by the collection, in §4.2.8 +
- replaceWith(nodes...), in §4.2.8 +
- replaceWith(nodes), in §4.2.8 +
- represented by the collection, in §4.2.10
- root
@@ -5472,6 +5479,7 @@
shadowRoot, in §4.9
- ShadowRootInit, in §4.9
- ShadowRootMode, in §4.9 +
- shadow tree, in §4.2.2
- SHOW_ALL, in §6.3
- SHOW_ATTRIBUTE, in §6.3
- SHOW_CDATA_SECTION, in §6.3 @@ -5497,7 +5505,7 @@
start offset, in §5.2
- START_TO_END, in §5.2
- START_TO_START, in §5.2 -
- static collection, in §4.2.8 +
- static collection, in §4.2.10
- stopImmediatePropagation(), in §3.2
- stop immediate propagation flag, in §3.2
- stopPropagation(), in §3.2