/// <summary> /// /// </summary> /// <param name="node"></param> /// <param name="child"></param> /// <returns></returns> private Node PreInsert(Node node, Node child) { // Reference: https://www.w3.org/TR/2015/REC-dom-20151119/#concept-node-pre-insert EnsurePreInsertionValidity(node, child); if (node == child) { child = node.NextSibling; } OwnerDocument.AdoptNode(node); Insert(node, child); return(node); }