From 5427fdab955c1176c3969e20573dfa4725ef6e0e Mon Sep 17 00:00:00 2001 From: Luke Warlow Date: Wed, 17 Apr 2024 17:54:07 +0100 Subject: [PATCH] Remove insertAdjacentHTML method. This has been moved to the HTML spec. --- index.html | 118 ++--------------------------------------------------- 1 file changed, 3 insertions(+), 115 deletions(-) diff --git a/index.html b/index.html index 34fa8bf..3b65c03 100644 --- a/index.html +++ b/index.html @@ -256,12 +256,6 @@

Extensibility

Extensions to the Element interface

-
-    partial interface Element {
-      [CEReactions] undefined insertAdjacentHTML(DOMString position, HTMLString text);
-    };
-  
- @@ -270,116 +264,9 @@

Extensibility

-
-
element . insertAdjacentHTML ( position, text ) -
Parses the given string text as HTML or XML and inserts the resulting nodes into - the tree in the position given by the position argument, as follows: - -
-
"beforebegin" -
Before the element itself (i.e., after element's previous sibling) - -
"afterbegin" -
Just inside the element, before its first child. - -
"beforeend" -
Just inside the element, after its last child. - -
"afterend" -
After the element itself (i.e., before element's next sibling) -
- -

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). -

- -

The - insertAdjacentHTML(position, text) - method must run these steps: - -

    -
  1. Use the first matching item from this list: - -
    -
    If position is an ASCII case-insensitive match for the string - "beforebegin" -
    If position is an ASCII case-insensitive match for the string - "afterend" -
    Let context be the context object's parent. - -

    If context is null or a Document, throw a - "NoModificationAllowedError" DOMException. - -

    If position is an ASCII case-insensitive match for the string - "afterbegin" -
    If position is an ASCII case-insensitive match for the string - "beforeend" -
    Let context be the context object. - -
    Otherwise -
    Throw a "SyntaxError" DOMException. -
    - -
  2. If context is not an Element or the following are all true: - - -

    let context be a new Element with - -

    - -
  3. Let fragment be the result of invoking the fragment parsing algorithm with - text as markup, and context as the context element. - -
  4. Use the first matching item from this list: - -
    -
    If position is an ASCII case-insensitive match for the string - "beforebegin" -
    Insert fragment into the context object's parent before - the context object. - -
    If position is an ASCII case-insensitive match for the string - "afterbegin" -
    Insert fragment into the context object before its - first child. - -
    If position is an ASCII case-insensitive match for the string - "beforeend" -
    Append fragment to the context object. - -
    If position is an ASCII case-insensitive match for the string - "afterend" -
    Insert fragment into the context object's parent before - the context object's next sibling. -
    -
+ -

No special handling for template elements is included in the - above "afterbegin" and "beforeend" cases. 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 wish to use - template.content.insertAdjacentHTML - instead of directly manipulating the child nodes of a template - element.

+

The definition of insertAdjacentHTML has moved to the HTML Standard.

@@ -1540,6 +1427,7 @@

Dependencies

  • The [CEReactions] IDL extended attribute
  • The innerHTML property;
  • The outerHTML property; +
  • The insertAdjacentHTML method; The DOM specification [[!DOM4]] defines the following terms used in this document: