mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-09 11:25:00 +00:00
Bug 672438 - Notify only if AppendChildTo succeeds. r=hsivonen
This commit is contained in:
parent
64a2c57937
commit
24126c8471
@ -47,7 +47,7 @@ class nsHtml5PendingNotification {
|
||||
|
||||
nsHtml5PendingNotification(nsIContent* aParent)
|
||||
: mParent(aParent),
|
||||
mChildCount(aParent->GetChildCount())
|
||||
mChildCount(aParent->GetChildCount() - 1)
|
||||
{
|
||||
MOZ_COUNT_CTOR(nsHtml5PendingNotification);
|
||||
}
|
||||
|
@ -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;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user