Bug 774914 - Ensure newNode is orphan before replacing a node in JSDOMParser (r=mfinkle)

This commit is contained in:
Lucas Rocha 2012-08-25 11:27:27 +01:00
Родитель b58f751009
Коммит 33ae3d7824
1 изменённых файлов: 3 добавлений и 0 удалений

Просмотреть файл

@ -323,6 +323,9 @@
if (childIndex == -1) {
throw "replaceChild: node not found";
} else {
if (newNode.parentNode)
newNode.parentNode.removeChild(newNode);
childNodes[childIndex] = newNode;
newNode.parentNode = this;
oldNode.parentNode = null;