From 10dbae49d215ddc3a6506321a065e26e7d55251e Mon Sep 17 00:00:00 2001
From: Anne van Kesteren The A document tree is a node tree whose
-root is a document.
+root is a document.
- The document element of a document is the element whose
-parent is that document, if it exists; otherwise null.
+ The document element of a document is the element
+whose parent is that document, if it exists; otherwise null.
Per the node tree constraints, there can be only one such
element.
A node is in a document tree if its root is a
-document.
+document.
A node is in a document if it is in a document tree.
The term in a document is no longer supposed to be used. It indicates that
@@ -2370,7 +2370,7 @@ referred to as the light tree.debug
function will be invoked twice. Each time the event's
{{Event/target}} attribute value will be the span
element. The first time
-{{Event/currentTarget}} attribute's value will be the document, the second time the
+{{Event/currentTarget}} attribute's value will be the document, the second time the
body
element. {{Event/eventPhase}} attribute's value switches from
{{Event/CAPTURING_PHASE}} to {{Event/BUBBLING_PHASE}}. If an event listener was registered
for the span
element, {{Event/eventPhase}} attribute's value would have
@@ -2340,16 +2340,16 @@ therefore alone in a tree.
Document tree
A node is connected if its -shadow-including root is a document. +shadow-including root is a document.
If either node is a {{Text}} node and parent is a - document, or node is a doctype and parent is not a - document, then throw a "{{HierarchyRequestError!!exception}}" {{DOMException}}. + document, or node is a doctype and parent is not a + document, then throw a "{{HierarchyRequestError!!exception}}" {{DOMException}}.
If parent is a document, and any of the statements below, switched on the - interface node implements, are true, then throw a +
If parent is a document, and any of the statements below, switched on + the interface node implements, are true, then throw a "{{HierarchyRequestError!!exception}}" {{DOMException}}.
If either node is a {{Text}} node and parent is a - document, or node is a doctype and parent is not a - document, then throw a "{{HierarchyRequestError!!exception}}" {{DOMException}}. + document, or node is a doctype and parent is not a + document, then throw a "{{HierarchyRequestError!!exception}}" {{DOMException}}.
If parent is a document, and any of the statements below, switched on the - interface node implements, are true, then throw a +
If parent is a document, and any of the statements below, switched on + the interface node implements, are true, then throw a "{{HierarchyRequestError!!exception}}" {{DOMException}}.
Each node has an associated node document, set upon creation, that is a -document. +document.
A node's node document can be changed by the adopt algorithm. @@ -4334,10 +4334,11 @@ statement, switching on the interface this implements: if this is connected; otherwise false.
The ownerDocument
getter steps are to return null,
-if this is a document; otherwise this's node document.
+if this is a document; otherwise this's node document.
-
The node document of a document is that document itself. -All nodes have a node document at all times. +
The node document of a document is that +document itself. All nodes have a node document at all +times.
The getRootNode(options)
method steps are to
return this's shadow-including root if
@@ -5152,9 +5153,9 @@ dictionary ElementCreationOptions {
{{Document}} nodes are simply known as documents. -
A document's node document is itself. +
A document's node document is itself. -
Each document has an associated +
Each document has an associated encoding (an encoding), content type (a string), URL (a URL), @@ -5166,18 +5167,19 @@ known as documents. [[!URL]] [[!HTML]] -
Unless stated otherwise, a document's encoding is the utf-8 -encoding, content type is +
Unless stated otherwise, a document's encoding is the
+utf-8 encoding, content type is
"application/xml
", URL is "about:blank
",
origin is an opaque origin,
type is "xml
", mode is
"no-quirks
", and its allow declarative shadow roots is false.
-
A document is said to be an XML document if its type
-is "xml
"; otherwise an HTML document. Whether a document is an
-HTML document or an XML document affects the behavior of certain APIs.
+
A document is said to be an XML document if its
+type is "xml
"; otherwise an HTML document.
+Whether a document is an HTML document or an XML document affects the
+behavior of certain APIs.
-
A document is said to be in +
A document is said to be in
no-quirks mode if its
mode is "no-quirks
",
quirks mode if its mode
@@ -5196,16 +5198,16 @@ is "quirks
", and
are nonsensical.)
-
A document's get the parent algorithm, given an event, returns +
A document's get the parent algorithm, given an event, returns
null if event's {{Event/type}} attribute value is "load
" or
-document does not have a browsing context; otherwise the
-document's relevant global object.
+document does not have a browsing context; otherwise the
+document's relevant global object.
document = new {{Document()}}
- document . {{Document/implementation}}
Document
. [[!HTML]]
Unlike {{DOMImplementation/createDocument()}}, this constructor does not -return an {{XMLDocument}} object, but a document ({{Document}} object). +return an {{XMLDocument}} object, but a document ({{Document}} object).
The
implementation
getter steps are to return the
@@ -5297,7 +5299,7 @@ otherwise "CSS1Compat
".
Returns an {{HTMLCollection}} of the elements in the object on which the method - was invoked (a document or an element) that have all the classes given by + was invoked (a document or an element) that have all the classes given by classNames. The classNames argument is interpreted as a space-separated list of classes.
Returns a copy of node. If deep is true, the copy also includes the node's descendants. -
If node is a document or a shadow root, throws a +
If node is a document or a shadow root, throws a "{{NotSupportedError!!exception}}" {{DOMException}}.
If node is a document or shadow root, then throw a - "{{NotSupportedError!!exception}}" {{DOMException}}. +
If node is a document or shadow root, then throw + a "{{NotSupportedError!!exception}}" {{DOMException}}.
Return a clone of node, with this and the clone children flag set if deep is true. @@ -5627,7 +5629,7 @@ these steps:
The adoptNode(node)
method steps are:
If node is a document, then throw a "{{NotSupportedError!!exception}}" {{DOMException}}.
If node is a shadow root, then throw a @@ -5786,9 +5788,8 @@ method steps are:
User agents must create a {{DOMImplementation}} object whenever a document is +created and associate it with that document.
[Exposed=Window] @@ -5831,7 +5832,7 @@ interface DOMImplementation {
doc = document . {{Document/implementation}} . createHTMLDocument([title])
Return a new doctype, with qualifiedName as its name, publicId as its public ID, and systemId as its system ID, and with its node document set to the associated - document of this. + document of this.
No check is performed that publicId code points match the @@ -5874,7 +5875,7 @@ method steps are:
If element is non-null, append element to document.
document's origin is this's associated - document's origin. + document's origin.
document's content type is determined by namespace: @@ -5898,7 +5899,7 @@ method steps are: method steps are:
Let doc be a new document that is an HTML document. +
Let doc be a new document that is an HTML document.
Set doc's content type to "text/html
".
@@ -5927,8 +5928,8 @@ method steps are:
Append the result of creating an element given doc,
"body
", and the HTML namespace, to the <{html}> element created earlier.
Return doc.