Bug 672438 - Notify only if AppendChildTo succeeds. r=hsivonen

This commit is contained in:
Mats Palmgren
2011-07-20 22:22:27 +02:00
parent 98b2c4a45f
commit 0ecb2755a7
2 changed files with 7 additions and 4 deletions

View File

@@ -210,8 +210,10 @@ nsHtml5TreeOperation::Append(nsIContent* aNode,
if (NS_LIKELY(executorDoc == parentDoc)) {
// the usual case. the parent is in the parser's doc
aBuilder->PostPendingAppendNotification(aParent, aNode);
rv = aParent->AppendChildTo(aNode, PR_FALSE);
if (NS_SUCCEEDED(rv)) {
aBuilder->PostPendingAppendNotification(aParent, aNode);
}
return rv;
}
@@ -220,8 +222,9 @@ nsHtml5TreeOperation::Append(nsIContent* aNode,
PRUint32 childCount = aParent->GetChildCount();
rv = aParent->AppendChildTo(aNode, PR_FALSE);
nsNodeUtils::ContentAppended(aParent, aNode, childCount);
if (NS_SUCCEEDED(rv)) {
nsNodeUtils::ContentAppended(aParent, aNode, childCount);
}
parentDoc->EndUpdate(UPDATE_CONTENT_MODEL);
return rv;
}