diff options
-rw-r--r-- | dom/base/nsNodeUtils.cpp | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/dom/base/nsNodeUtils.cpp b/dom/base/nsNodeUtils.cpp index 8806773a4..517700907 100644 --- a/dom/base/nsNodeUtils.cpp +++ b/dom/base/nsNodeUtils.cpp @@ -498,6 +498,15 @@ nsNodeUtils::CloneAndAdopt(nsINode *aNode, bool aClone, bool aDeep, } } + if (aNode->HasProperties()) { + bool ok = aNodesWithProperties.AppendObject(aNode); + MOZ_RELEASE_ASSERT(ok, "Out of memory"); + if (aClone) { + ok = aNodesWithProperties.AppendObject(clone); + MOZ_RELEASE_ASSERT(ok, "Out of memory"); + } + } + // Cloning template element. if (aDeep && aClone && IsTemplateElement(aNode)) { DocumentFragment* origContent = @@ -541,15 +550,6 @@ nsNodeUtils::CloneAndAdopt(nsINode *aNode, bool aClone, bool aDeep, } #endif - if (aNode->HasProperties()) { - bool ok = aNodesWithProperties.AppendObject(aNode); - if (aClone) { - ok = ok && aNodesWithProperties.AppendObject(clone); - } - - NS_ENSURE_TRUE(ok, NS_ERROR_OUT_OF_MEMORY); - } - clone.forget(aResult); return NS_OK; |