Re: [whatwg/dom] Suggestion: `Node.insertAfter(newNode, referenceNode)` (#986)

@WebReflection That is correct. The idea is that you're inserting a node, but specifically after *nothing*. And if nothing's supposed to be before it, then you're essentially prepending it. And so yes, that's the intent.

- `elem.insertAfter(node, null)` → `elem.prepend(node)`
- `elem.insertAfter(node, refNode)` → `refNode.after(node)`
- `elem.insertAfter(node, elem.lastChild)` → `elem.append(node)`

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/whatwg/dom/issues/986#issuecomment-860469881

Received on Monday, 14 June 2021 07:55:36 UTC