Bug 1425440 - Replace RemoveChildAt_Deprecated with RemoveChildNode in nsHtml5TreeOperation, r=catalinb
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user