diff --git a/dom.bs b/dom.bs index d5beb1fa..3a38ce3f 100644 --- a/dom.bs +++ b/dom.bs @@ -3448,14 +3448,13 @@ standards that want to define APIs shared between documents and strings nodes, and document document:
Replace each string of nodes with a new {{Text}} node whose - data is the string and node document is - document. +
Replace each string in nodes with the result of creating a text node given + document and the string.
If nodes's size is 1, then return nodes[0]. -
Let fragment be a new {{DocumentFragment}} node whose - node document is document. +
Let fragment be the result of creating a document fragment given + document.
For each node of nodes: append node to fragment. @@ -4508,6 +4507,21 @@ get a direct instance of it.
Each node also has a registered observer list. +
To create a node that implements an interface interface, given a +document document: + +
Assert: interface is neither {{Document}} nor an interface that + inherits from {{Document}}. To create a document, use + create a document instead. + +
Return a new node that implements interface, in + document's relevant realm, with its node document set to + document. +
Let node be null. -
If string is not the empty string, then set node to a new {{Text}} - node whose data is string and - node document is parent's node document. +
If string is not the empty string, then set node to the result of + creating a text node given parent's node document and + string.
Replace all with node within parent.
Otherwise, if node is a document, set copy to the result + of creating a document that implements the same interfaces as node, given + document's relevant realm. + +
Otherwise, set copy to the result of creating a node that + implements the same interfaces as node, given document. +
Otherwise, set copy to a node that implements the same - interfaces as node, and fulfills these additional requirements, switching on the - interface node implements: +
Fulfill these additional requirements, switching on the interface node + implements:
load"
document does not have a browsing context; otherwise the
document's relevant global object.
+To create a document that implements an interface interface, +given a realm realm: + +
Assert: interface is {{Document}} or an interface that inherits from + {{Document}}. + +
Return a new node that implements interface, in + realm. +
The createDocumentFragment() method steps are to
-return a new {{DocumentFragment}} node whose node document is
-this.
+return the result of creating a document fragment given this.
The createTextNode(data) method steps are
-to return a new {{Text}} node whose data is data
-and node document is this.
+to return the result of creating a text node given this and data.
The createCDATASection(data) method steps
are:
@@ -6004,27 +6035,21 @@ are:
If data contains the string "]]>", then throw an
"{{InvalidCharacterError!!exception}}" {{DOMException}}.
-
Return a new {{CDATASection}} node with its data set - to data and node document set to this. +
Let node be the result of creating a node that implements + {{CDATASection}}, given this. + +
Set node's data to data. + +
Return node. -
The createComment(data) method steps are
-to return a new {{Comment}} node whose data is data
-and node document is this.
+
The createComment(data) method steps are to
+return the result of creating a comment node given this and data.
The
createProcessingInstruction(target, data)
-method steps are:
-
-
Let pi be a new {{ProcessingInstruction}} - node, with node document set to this. - -
Initialize pi with target and - data. - -
Return pi. -
Return the result of creating an attribute given this and localName.
The
@@ -6229,9 +6253,8 @@ method steps are:
[=validate and extract|validating and extracting=] namespace and
qualifiedName given "attribute".
-
Return a new attribute whose namespace is namespace, - namespace prefix is prefix, local name is - localName, and node document is this. +
Return the result of creating an attribute given this, localName, + namespace, and prefix.
If name is not a valid doctype name, then throw an "{{InvalidCharacterError}}" {{DOMException}}. -
Return a new doctype, with name 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. +
Return the result of creating a doctype given the associated document of + this, name, publicId, and systemId.
The @@ -6414,7 +6435,8 @@ method steps are: method steps are:
Let document be a new {{XMLDocument}}. +
Let document be the result of creating a document that implements + {{XMLDocument}}, given this's relevant realm.
Let element be null. @@ -6451,13 +6473,16 @@ method steps are: method steps are:
Let doc be a new document that is an HTML document. +
Let doc be the result of creating a document that implements + {{Document}}, given this's relevant realm. + +
Set doc's type to "html" and
+ content type to "text/html".
-
Set doc's content type to "text/html".
+
Let doctype be the result of creating a doctype given doc and
+ "html".
-
Append a new doctype, with "html" as its
- name and with its node document set to doc, to
- doc.
+
Append doctype to doc.
Append the result of creating an element given doc,
"html", and the HTML namespace, to doc.
@@ -6472,9 +6497,10 @@ method steps are:
Append the result of creating an element given doc,
"title", and the HTML namespace, to the <{head}> element created earlier.
-
Append a new {{Text}} node, with its data set - to title (which could be the empty string) and its node document set - to doc, to the <{title}> element created earlier. +
Let text be the result of creating a text node given doc and + title (which could be the empty string). + +
Append text to the <{title}> element created earlier.
Append the result of creating an element given doc, @@ -6511,13 +6537,25 @@ interface DocumentType : Node { doctypes.
Doctypes have an associated -name, -public ID, and -system ID. +name (a string), +public ID (a string), and +system ID (a string). + +
To create a doctype given a document document, a string +name, and optionally a string publicId (default the empty string) and a string +systemId (default the empty string): -
When a doctype is created, its name is always given. Unless -explicitly given when a doctype is created, its public ID and system ID are the -empty string. +
Let doctype be the result of creating a node that implements + {{DocumentType}}, given document. + +
Set doctype's name to name, public ID to + publicId, and system ID to systemId. + +
Return doctype. +
The name getter steps are to return
this's name.
@@ -6567,7 +6605,11 @@ or if B's root has a non-null element and for shadow roots, and impacts the
pre-insert and replace algorithms.
-
To create a document fragment given a document +document: return the result of creating a node that implements +{{DocumentFragment}}, given document. +
The @@ -7083,13 +7125,15 @@ a string-or-null prefix, a string state, a string-or-null null or a {{CustomElementRegistry}} object registry:
Let element be a new element that implements interface,
- with namespace set to namespace, namespace prefix
- set to prefix, local name set to localName,
- custom element registry set to registry,
- custom element state set to state,
- custom element definition set to null, is value
- set to is, and node document set to document.
+
Let element be the result of creating a node that implements + interface, given document. + +
Set element's namespace to namespace,
+ namespace prefix to prefix, local name to
+ localName, custom element registry to registry,
+ custom element state to state,
+ custom element definition to null, and is value
+ to is.
Assert: element's attribute list is empty. @@ -7291,12 +7335,10 @@ an optional null or string prefix (default null), and an optional nul getting an attribute given namespace, localName, and element. -
Change attribute to value.
If attribute is non-null, then change attribute to verifiedValue and return. -
Set attribute to a new attribute whose local name is - qualifiedName, value is verifiedValue, and - node document is this's node document. +
Set attribute to the result of creating an attribute given this's + node document, qualifiedName, null, null, and verifiedValue.
Append attribute to this. @@ -7662,11 +7703,9 @@ method steps are:
If attribute is null:
If force is not given or is true, create an attribute whose - local name is qualifiedName, value is the empty - string, and node document is this's node document, then - append this attribute to this, and then return - true. +
If force is not given or is true, then append + the result of creating an attribute given this's node document and + qualifiedName to this, and then return true.
Return false.
Let shadow be a new shadow root whose node document - is element's node document, host is - element, and mode is mode. +
Let shadow be the result of creating a node that implements + {{ShadowRoot}}, given element's node document. + +
Set shadow's host to element. + +
Set shadow's mode to mode.
Set shadow's delegates focus to delegatesFocus.
@@ -8013,9 +8055,8 @@ method steps are to return the result of running insert adjacent, give
- Let text be a new {{Text}} node whose data
- is data and node document is this's
- node document.
+ Let text be the result of creating a text node given this's
+ node document and data.
Run insert adjacent, given this, where, and text.
@@ -8177,13 +8218,23 @@ to as content attributes to avoid confusion with IDL attributes.
User agents could have this as an internal slot as an optimization.
- When an attribute is created, its
-local name is given. Unless explicitly
-given when an attribute is created, its
-namespace,
-namespace prefix, and
-element are set to null, and its
-value is set to the empty string.
+ To create an attribute given a document document, a
+string localName, and optionally a string-or-null namespace (default null), a
+string-or-null prefix (default null), and a string value (default the empty
+string):
+
+ Let attribute be the result of creating a node that implements {{Attr}},
+ given document.
+
+ Set attribute's namespace to namespace,
+ namespace prefix to prefix, local name to
+ localName, and value to value.
+
+ Return attribute.
+ An
+
+A attribute
@@ -8477,6 +8528,20 @@ the {{Text}} node children of node, in <
node, in tree order.
To create a text node given a document document and a +string data: + +
Let text be the result of creating a node that implements {{Text}}, given + document. + +
Set text's data to data. + +
Return text. +
Let newData be the result of substringing data of node with offset and count. -
Let newNode be a new {{Text}} node whose - node document is node's node document and - data is newData. +
Let newNode be the result of creating a text node given node's + node document and newData.
Let parent be node's parent. @@ -8626,6 +8690,21 @@ interface ProcessingInstruction : CharacterData { attribute map, which is a map, initially empty. +
To create a processing instruction node given a document +document, a string target, and a string data: + +
Let pi be the result of creating a node that implements + {{ProcessingInstruction}}, given document. + +
Initialize pi with target and + data. + +
Return pi. +
To initialize a {{ProcessingInstruction}} node pi, with target and data: @@ -8829,6 +8908,20 @@ interface Comment : CharacterData { data is data. +
To create a comment node given a document document and +a string data: + +
Let comment be the result of creating a node that implements {{Comment}}, + given document. + +
Set comment's data to data. + +
Return comment. +
The new Comment(data)
constructor steps are to set this's data to data and
@@ -9594,9 +9687,8 @@ method steps are:
range:
Let fragment be a new {{DocumentFragment}} node whose - node document is range's start node's - node document. +
Let fragment be the result of creating a document fragment given + range's start node's node document.
If range is collapsed, then return fragment.