Re: [dom] Consider banning insertNode() of the Range's start node (#63)

In the non-text node case, you're trying to insert a node as a descendant of itself.  That will obviously have to throw a HierarchyRequestError in any UA, just like it does if you do it via insertBefore or whatever.  This requires no additional logic in insertNode, beyond insertion validity checks that must be present when you do any insertion.  In the text node case you're splitting the node and trying to insert it into its current parent, which is perfectly valid in principle, and needs special logic in insertNode if we don't want to allow it.

---
Reply to this email directly or view it on GitHub:
https://github.com/whatwg/dom/issues/63#issuecomment-146546850

Received on Thursday, 8 October 2015 13:36:55 UTC