mirror of
https://github.com/roytam1/palemoon27.git
synced 2026-05-26 14:18:48 +00:00
Handle failing node adoption properly.
This commit is contained in:
@@ -471,8 +471,14 @@ nsNodeUtils::CloneAndAdopt(nsINode *aNode, bool aClone, bool aDeep,
|
||||
JSAutoCompartment ac(cx, wrapper);
|
||||
rv = ReparentWrapper(cx, wrapper);
|
||||
if (NS_FAILED(rv)) {
|
||||
if (wasRegistered) {
|
||||
aNode->OwnerDoc()->UnregisterActivityObserver(aNode->AsElement());
|
||||
}
|
||||
aNode->mNodeInfo.swap(newNodeInfo);
|
||||
|
||||
if (wasRegistered) {
|
||||
aNode->OwnerDoc()->RegisterActivityObserver(aNode->AsElement());
|
||||
}
|
||||
return rv;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user