Bug 772332 part 1 - Don't access siblings of nodes that might be deleted; r=ehsan

This commit is contained in:
Aryeh Gregor 2012-07-13 09:33:42 +03:00
parent 81be98cff9
commit a72a488e1a

View File

@ -2834,10 +2834,8 @@ nsHTMLEditRules::DeleteNonTableElements(nsINode* aNode)
return mHTMLEditor->DeleteNode(aNode->AsDOMNode());
}
for (nsCOMPtr<nsIContent> child = aNode->GetLastChild();
child;
child = child->GetPreviousSibling()) {
nsresult rv = DeleteNonTableElements(child);
for (PRInt32 i = aNode->GetChildCount() - 1; i >= 0; --i) {
nsresult rv = DeleteNonTableElements(aNode->GetChildAt(i));
NS_ENSURE_SUCCESS(rv, rv);
}
return NS_OK;