mirror of
https://github.com/roytam1/palemoon27.git
synced 2026-05-26 14:30:27 +00:00
Ensure expected DOM tree operations when calling insertBefore.
This commit is contained in:
@@ -379,7 +379,8 @@ HTMLTableElement::CreateTHead()
|
||||
}
|
||||
|
||||
ErrorResult rv;
|
||||
nsINode::InsertBefore(*head, nsINode::GetFirstChild(), rv);
|
||||
nsCOMPtr<nsINode> refNode = nsINode::GetFirstChild();
|
||||
nsINode::InsertBefore(*head, refNode, rv);
|
||||
}
|
||||
return head.forget();
|
||||
}
|
||||
@@ -470,7 +471,7 @@ HTMLTableElement::CreateTBody()
|
||||
NS_NewHTMLTableSectionElement(nodeInfo.forget());
|
||||
MOZ_ASSERT(newBody);
|
||||
|
||||
nsIContent* referenceNode = nullptr;
|
||||
nsCOMPtr<nsIContent> referenceNode = nullptr;
|
||||
for (nsIContent* child = nsINode::GetLastChild();
|
||||
child;
|
||||
child = child->GetPreviousSibling()) {
|
||||
@@ -582,7 +583,8 @@ HTMLTableElement::InsertRow(int32_t aIndex, ErrorResult& aError)
|
||||
HTMLTableSectionElement* section =
|
||||
static_cast<HTMLTableSectionElement*>(rowGroup.get());
|
||||
nsIHTMLCollection* rows = section->Rows();
|
||||
rowGroup->InsertBefore(*newRow, rows->Item(0), aError);
|
||||
nsCOMPtr<nsINode> refNode = rows->Item(0);
|
||||
rowGroup->InsertBefore(*newRow, refNode, aError);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user