Bug 718504 - Remove some GetChildAt callers; r=smaug

This commit is contained in:
Ms2ger
2012-01-25 08:50:07 +01:00
parent f6f54a79f5
commit 5aaaad9380
8 changed files with 40 additions and 44 deletions

View File

@@ -289,8 +289,8 @@ nsHtml5TreeOperation::Perform(nsHtml5TreeOpExecutor* aBuilder,
PRUint32 childCount = parent->GetChildCount();
bool didAppend = false;
while (node->GetChildCount()) {
nsCOMPtr<nsIContent> child = node->GetChildAt(0);
while (node->HasChildren()) {
nsCOMPtr<nsIContent> child = node->GetFirstChild();
rv = node->RemoveChildAt(0, true);
NS_ENSURE_SUCCESS(rv, rv);
rv = parent->AppendChildTo(child, false);
@@ -517,8 +517,8 @@ nsHtml5TreeOperation::Perform(nsHtml5TreeOpExecutor* aBuilder,
aBuilder->GetDocument());
PRUint32 pos = foster->IndexOf(table);
nsIContent* previousSibling = foster->GetChildAt(pos - 1);
nsIContent* previousSibling = table->GetPreviousSibling();
if (previousSibling && previousSibling->IsNodeOfType(nsINode::eTEXT)) {
return AppendTextToTextNode(buffer,
length,