diff --git a/dom.bs b/dom.bs index 5266d1bbe..e337fd35a 100644 --- a/dom.bs +++ b/dom.bs @@ -815,7 +815,7 @@ method steps are:
If this's dispatch flag is set, then return. -
Initialize this with type, bubbles, and +
Initialize this with type, bubbles, and cancelable.
If this's dispatch flag is set, then return. -
Initialize this with type, bubbles, and +
Initialize this with type, bubbles, and cancelable.
Set this's {{CustomEvent/detail}} attribute to detail. @@ -5997,19 +5997,13 @@ and node document is this. method steps are:
[=XML/Name=] production,
- then throw an "{{InvalidCharacterError!!exception}}" {{DOMException}}.
+ Let pi be a new {{ProcessingInstruction}} + node, with node document set to this. -
?>", then throw an
- "{{InvalidCharacterError!!exception}}" {{DOMException}}.
+ Initialize pi with target and + data. -
Return pi.
To replace data of a node node -with an integer offset, integer count, and string data: +with an integer offset, integer count, string data, and an optional +boolean piAttributesAlreadyUpdated (default false):
Let length be node's length.
@@ -8263,6 +8258,10 @@ with an integer offset, integer count, and string dat
end offset by data's length and decrease it by
count.
+ If node is a {{ProcessingInstruction}} node and
+ piAttributesAlreadyUpdated is false, then update attributes from data for
+ node.
+
If node's parent is non-null, then run the
children changed steps for node's parent.
[Exposed=Window]
interface ProcessingInstruction : CharacterData {
+ constructor(DOMString target, optional DOMString data = "");
+
readonly attribute DOMString target;
+
+ boolean hasAttributes();
+ sequence<DOMString> getAttributeNames();
+ DOMString? getAttribute(DOMString name);
+ undefined setAttribute(DOMString name, DOMString value);
+ undefined removeAttribute(DOMString name);
+ boolean toggleAttribute(DOMString name, optional boolean force);
+ boolean hasAttribute(DOMString name);
};
+pi = new ProcessingInstruction(target [, data = ""])
+ pi . {{ProcessingInstruction/target}}
+ pi . hasAttributes()
+ Returns true if pi has attributes; otherwise false. + +
pi . getAttributeNames()
+ Returns the names of all of pi's attributes. Cannot contain duplicates. + +
pi . getAttribute(name)
+ Returns the value of pi's attribute named name, and null if there is + no such attribute. + +
pi . setAttribute(name, value)
+ Sets pi's attribute named name to value. + +
pi . removeAttribute(name)
+ Removes pi's attribute named name. + +
pi . toggleAttribute(name [, force])
+ If force is not given, "toggles" name, removing it if it is + present and adding it if it is not present. If force is true, adds + name. If force is false, removes name. + +
Returns true if name is now present; otherwise false. + +
pi . hasAttribute(name)
+ Returns true if pi has an attribute named name; otherwise false. +
The
+new ProcessingInstruction(target, data)
+constructor steps are:
+
+
Set this's node document to current global object's
+ associated Document.
+
+
Initialize this with target and + data. + +
Update attributes from data for this. +
{{ProcessingInstruction}} nodes have an associated target. +
{{ProcessingInstruction}} nodes have an associated +attribute map, which is a +map, initially empty. +
+The hasAttributes() method steps are to
+return false if this's attribute map
+is empty; otherwise true.
+
The getAttributeNames() method steps
+are to return the result of getting the keys of this's
+attribute map.
+
The getAttribute(name) method
+steps are:
+
+
Set name to name in ASCII lowercase. + +
Return this's attribute map[name] + with default null. +
The
+setAttribute(name, value)
+method steps are:
+
+
If name is not a valid attribute local name, then throw an + "{{InvalidCharacterError!!exception}}" {{DOMException}}. + +
Set name to name in ASCII lowercase. + +
Set this's + attribute map[name] to value. + +
Update data from attributes for this. +
The removeAttribute(name)
+method steps are:
+
+
Set name to name in ASCII lowercase. + +
Remove this's + attribute map[name]. + +
Update data from attributes for this. +
The
+toggleAttribute(name, force)
+method steps are:
+
+
If name is not a valid attribute local name, then throw an + "{{InvalidCharacterError!!exception}}" {{DOMException}}. + +
Set name to name in ASCII lowercase. + +
Let attributes be this's attribute map. + +
If attributes[name] does not exist: + +
If force is not given or is true, set attributes[name] + to the empty string, update data from attributes for this, and then return true. + +
Return false. +
Otherwise, if force is not given or is false, remove + attributes[name], update data from attributes for this, and + then return false. + +
Return true. +
The hasAttribute(name)
+method steps are:
+
+
Set name to name in ASCII lowercase. + +
Return true if this's attribute map[name] + exists; otherwise false. +
To initialize a +{{ProcessingInstruction}} node pi with target and +data: + +
If target does not match the [=XML/Name=] production, then
+ throw an "{{InvalidCharacterError!!exception}}" {{DOMException}}.
+
+
+
If data contains the string "?>", then throw an
+ "{{InvalidCharacterError!!exception}}" {{DOMException}}.
+
+
Set pi's target to target. + +
Set pi's data to data. + +
Update attributes from data for pi. +
To update attributes from data for a {{ProcessingInstruction}} node +pi: + +
Clear pi's attribute map. + +
Let document be a new {{Document}} node whose type is
+ "html".
+
+
Let html be the concatenation of "<html ",
+ pi's data, and ">".
+
+
Parse HTML from a string + given document and html. + +
For each attribute of document's + document element's attribute list, set pi's + attribute map[attribute's local name] + to attribute's value. +
To update data from attributes for a {{ProcessingInstruction}} node +pi: + +
Let data be the empty string. + +
For each name → value of pi's + attribute map: + +
If data is not the empty string, then append U+0020 SPACE to data. + +
Append name to data. + +
Append U+003D (=) to data. + +
Append U+0022 (") to data. + +
Append the result of + escaping a string given + value to data. + +
Append U+0022 (") to data. +
Replace data of pi with 0, pi's length, + data, and true. +