diff --git a/source b/source index 68971fdbad..f97f80ec94 100644 --- a/source +++ b/source @@ -112353,6 +112353,7 @@ document.body.appendChild(frame) [CEReactions] attribute [LegacyNullToEmptyString] HTMLString innerHTML; [CEReactions] attribute [LegacyNullToEmptyString] HTMLString outerHTML; + [CEReactions] undefined insertAdjacentHTML(DOMString position, HTMLString string); }; partial interface ShadowRoot { @@ -112861,6 +112862,139 @@ enum DOMParserSupportedType { +
insertAdjacentHTML()
methodThe insertAdjacentHTML()
+ method has a number of outstanding issues in the DOM Parsing and Serialization issue tracker, documenting various problems
+ with its specification.
element.insertAdjacentHTML(position, string)
Parses string as HTML or XML and inserts the resulting nodes into the tree in + the position given by the position argument, as follows:
+ +beforebegin
"afterbegin
"beforeend
"afterend
"Throws a "SyntaxError
" DOMException
if the arguments
+ have invalid values (e.g., in the case of an XML document,
+ if the given string is not well-formed).
Throws a "NoModificationAllowedError
" DOMException
+ if the given position isn't possible (e.g. inserting elements after the root element of a
+ Document
).
This method performs no sanitization to remove potentially-dangerous elements
+ and attributes like script
or event handler content attributes.
Element
's insertAdjacentHTML(position,
+ string)
method steps are:
Let context be null.
Use the first matching item from this list:
+beforebegin
"afterend
"Set context to this's parent.
If context is null or a Document
, throw a
+ "NoModificationAllowedError
" DOMException
.
afterbegin
"beforeend
"Throw a "SyntaxError
" DOMException
.
If context is not an Element
or all of the following are true:
context's node document is an HTML document;
context's local name is
+ "html
"; and
context's namespace is the + HTML namespace,
set context to the result of creating an
+ element given this's node document, body
, and
+ the HTML namespace.
Let fragment be the result of invoking the fragment parsing algorithm + steps with context and string.
+beforebegin
"Insert fragment into + this's parent before this.
+afterend
"Insert fragment into + this before its first child.
+afterbegin
"Append fragment to + this.
+beforeend
"Insert fragment into + this's parent before this's + next sibling.
+As with other direct Node
-manipulation APIs (and unlike innerHTML
), insertAdjacentHTML()
does not include any special
+ handling for template
elements. In most cases you will want to use templateEl.content.insertAdjacentHTML()
instead of directly
+ manipulating the child nodes of a template
element.
The setTimeout()
and