diff --git a/dom.bs b/dom.bs index 4c3fe8ed2..44de9d215 100644 --- a/dom.bs +++ b/dom.bs @@ -972,8 +972,8 @@ object, an event listener is a broader concept as can be seen above. which takes an event event, and returns an {{EventTarget}} object. Unless specified otherwise it returns null. -
Nodes, shadow roots, and documents -override the get the parent algorithm. +
Nodes, shadow roots, and documents override the +get the parent algorithm.
Each {{EventTarget}} object can have an associated activation behavior algorithm. The @@ -2218,7 +2218,7 @@ It is represented as follows:
html
html
class
="e
"
@@ -4097,7 +4097,7 @@ interface Node : EventTarget {
[CEReactions] attribute DOMString? textContent;
[CEReactions] undefined normalize();
- [CEReactions, NewObject] Node cloneNode(optional boolean deep = false);
+ [CEReactions, NewObject] Node cloneNode(optional boolean subtree = false);
boolean isEqualNode(Node? otherNode);
boolean isSameNode(Node? otherNode); // legacy alias of ===
@@ -4294,7 +4294,7 @@ statement, switching on the interface this implements:
node . {{Node/ownerDocument}}
node . {{Node/getRootNode()}}
Text
node nod
node . cloneNode([deep = false])
+ node . cloneNode([subtree = false])
node . {{Node/isEqualNode(otherNode)}}
@@ -4533,33 +4533,83 @@ each descendant exclusive Text
node nod
HTML defines cloning steps for <{script}> and <{input}> -elements. SVG ought to do the same for its <{script}> elements, but does not call this out -at the moment. +
HTML defines cloning steps for several elements, such as <{input}>, <{script}>, +and <{template}>. SVG ought to do the same for its <{script}> elements, but does not. +
To clone a -node, with an optional document and clone children flag, run these -steps: - +
To clone a node given a node node +and an optional document document +(default node's node document), boolean +subtree (default false), and +node-or-null parent (default null):
If document is not given, then set document to node's - node document. +
Let copy be the result of cloning a single node given node and document. +
Run any cloning steps defined for node in + other applicable specifications and pass node, copy, and + subtree as parameters. + +
If parent is non-null, then append copy to + parent. + +
If subtree is true, then for each child of node's + children, in tree order: clone a node given child with + document set to document, + subtree set to subtree, and + parent set to copy. + +
If node is an element, node is a + shadow host, and node's shadow root's + clonable is true: + +
Assert: copy is not a shadow host. + +
Attach a shadow root with copy, node's + shadow root's mode, true, node's + shadow root's serializable, node's + shadow root's delegates focus, and node's + shadow root's slot assignment. + +
Set copy's shadow root's declarative + to node's shadow root's declarative. + +
For each child of node's shadow root's + children, in tree order: clone a node given child with + document set to document, + subtree set to subtree, and + parent set to copy's shadow root. +
Return copy. +
To clone a single node given a node node and +document document: + +
Let copy be null. +
If node is an element:
Let copy be the result of creating an element, given +
Set copy to the result of creating an element, given
document, node's local name, node's
namespace, node's namespace prefix, and
node's is
value.
@@ -4569,16 +4619,15 @@ dom-Range-extractContents, dom-Range-cloneContents -->
attribute list:
Let copyAttribute be a clone of attribute. +
Let copyAttribute be the result of cloning a single node given + attribute and document.
Append copyAttribute to copy.
Otherwise, let copy be a node that implements the same +
Otherwise, set copy to a node that implements the same interfaces as node, and fulfills these additional requirements, switching on the interface node implements: @@ -4608,54 +4657,28 @@ dom-Range-extractContents, dom-Range-cloneContents -->
Do nothing. +
If node is a document, then set document to copy.
Set copy's node document to document. -
Run any cloning steps defined for node in - other applicable specifications and pass copy, node, - document, and the clone children flag if set, as parameters. - -
If the clone children flag is set, then for each child - child of node, in tree order: append the result of - cloning child with document and the - clone children flag set, to copy. - -
If node is a shadow host whose shadow root's - clonable is true: - -
Assert: copy is not a shadow host. - -
Run attach a shadow root with copy, node's - shadow root's mode, true, node's - shadow root's serializable, node's - shadow root's delegates focus, and node's - shadow root's slot assignment. - -
Set copy's shadow root's declarative - to node's shadow root's declarative. - -
For each child child of node's - shadow root, in tree order: append the result of - cloning child with document and the - clone children flag set, to copy's shadow root. -
Return copy.
The cloneNode(deep)
method steps are:
+
The cloneNode(subtree)
method steps are:
If this is a shadow root, then throw a "{{NotSupportedError!!exception}}" {{DOMException}}. -
Return a clone of this, with the - clone children flag set if deep is true. +
Return the result of cloning a node given this with + subtree set to subtree.
A node A equals a
node B if all of the following conditions are true:
@@ -5127,7 +5150,7 @@ interface Document : Node {
[NewObject] Comment createComment(DOMString data);
[NewObject] ProcessingInstruction createProcessingInstruction(DOMString target, DOMString data);
- [CEReactions, NewObject] Node importNode(Node node, optional boolean deep = false);
+ [CEReactions, NewObject] Node importNode(Node node, optional boolean subtree = false);
[CEReactions] Node adoptNode(Node node);
[NewObject] Attr createAttribute(DOMString localName);
@@ -5188,9 +5211,9 @@ is "quirks
", and
mode is "limited-quirks
".
The mode is only ever changed from the default for documents created
- by the HTML parser based on the presence, absence, or value of the DOCTYPE string, and by a
- new browsing context (initial "about:blank
"). [[!HTML]]
+
The mode is only ever changed from the default for documents
+ created by the HTML parser based on the presence, absence, or value of the DOCTYPE string,
+ and by a new browsing context (initial "about:blank
"). [[!HTML]]
No-quirks mode was originally known as "standards mode" and limited-quirks mode was once known as "almost standards mode". They have been renamed because their details are now @@ -5554,9 +5577,9 @@ method steps are:
Returns a copy of node. If deep is true, the copy also includes the +
Returns a copy of node. If subtree is true, the copy also includes the node's descendants.
If node is a document or a shadow root, throws a @@ -5573,16 +5596,19 @@ method steps are: "{{HierarchyRequestError!!exception}}" {{DOMException}}.
The importNode(node, deep)
+
The importNode(node, subtree)
method steps are:
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. +
Return the result of cloning a node given node with + document set to this and + subtree set to subtree.
Specifications may define adopting steps for all or some nodes. The @@ -10402,6 +10428,7 @@ Daniel Clark, Daniel Glazman, Darien Maillet Valentine, Darin Fisher, +David Baron, David Bruant, David Flanagan, David Håsäther,