Fix DOMException in switchElementsAlt() (fixes #103) #104

Merged
robinnorth merged 1 commits from robinnorth-patch-1 into master 2018-01-17 17:07:03 -05:00

1 Commits

Author SHA1 Message Date
Robin North
8ef195f9ac Fix DOMException in switchElementsAlt()
Clone attribute nodes before setting on `oldEl` to prevent the following error:

```
DOMException: Failed to execute 'setNamedItem' on 'NamedNodeMap': The node provided is an attribute node that is already an attribute of another Element; attribute nodes must be explicitly cloned.
```
2018-01-17 19:12:12 +00:00