Bug 1425440 - Replace RemoveChildAt_Deprecated with RemoveChildNode in nsHtml5TreeOperation, r=catalinb

This commit is contained in:
Andrea Marchesini
2018-01-16 14:17:10 +01:00
parent 2ebdac2f74
commit 148709d732

View File

@@ -241,11 +241,8 @@ nsHtml5TreeOperation::Detach(nsIContent* aNode, nsHtml5DocumentBuilder* aBuilder
MOZ_ASSERT(aBuilder->IsInDocUpdate());
nsCOMPtr<nsINode> parent = aNode->GetParentNode();
if (parent) {
nsHtml5OtherDocUpdate update(parent->OwnerDoc(),
aBuilder->GetDocument());
int32_t pos = parent->IndexOf(aNode);
NS_ASSERTION((pos >= 0), "Element not found as child of its parent");
parent->RemoveChildAt_Deprecated(pos, true);
nsHtml5OtherDocUpdate update(parent->OwnerDoc(), aBuilder->GetDocument());
parent->RemoveChildNode(aNode, true);
}
}
@@ -262,7 +259,7 @@ nsHtml5TreeOperation::AppendChildrenToNewParent(nsIContent* aNode,
bool didAppend = false;
while (aNode->HasChildren()) {
nsCOMPtr<nsIContent> child = aNode->GetFirstChild();
aNode->RemoveChildAt_Deprecated(0, true);
aNode->RemoveChildNode(child, true);
nsresult rv = aParent->AppendChildTo(child, false);
NS_ENSURE_SUCCESS(rv, rv);
didAppend = true;