[whatwg/dom] Proposal: ParentNode.wrap() (#479)

The **ParentNode.wrap()** method would replace a node with the parent node, appending the replaced node to the parent node.

### Syntax

```js
ParentNode.wrap(node);
```

### Rationale:

Like `childNode.remove()`, we’re de-complicating the process of wrapping a node, e.g.:

```js
if (node.parentNode) {
  node.parentNode.insertBefore(parentNode, node).appendChild(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/479

Received on Tuesday, 18 July 2017 02:43:55 UTC