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
robinnorth commented 2018-01-17 14:12:54 -05:00 (Migrated from github.com)

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.

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. `
BehindTheMath commented 2018-01-17 17:30:40 -05:00 (Migrated from github.com)

TIL. Unfortunately, MDN doesn't have a page on NamedNodeMap.removeNamedItem(), and we don't have a test for that, so it wasn't caught until you found it.

Thank you.

TIL. Unfortunately, MDN doesn't have a page on `NamedNodeMap.removeNamedItem()`, and we don't have a test for that, so it wasn't caught until you found it. Thank you.
robinnorth commented 2018-01-17 17:48:37 -05:00 (Migrated from github.com)

@BehindTheMath you're very welcome, TIL too! 😉

@BehindTheMath you're very welcome, TIL too! 😉
Sign in to join this conversation.
No Reviewers
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: iLoveElysia/pjax#104