Bug 1309720, ensure expected DOM tree operations when calling insertBefore, r=ehsan

This commit is contained in:
Olli Pettay
2016-10-14 15:33:42 +03:00
parent 6f19ca1a32
commit 45a7bbd8ea
12 changed files with 33 additions and 17 deletions

View File

@@ -91,7 +91,8 @@ HTMLTableSectionElement::InsertRow(int32_t aIndex, ErrorResult& aError)
}
if (doInsert) {
nsINode::InsertBefore(*rowContent, rows->Item(aIndex), aError);
nsCOMPtr<nsINode> refNode = rows->Item(aIndex);
nsINode::InsertBefore(*rowContent, refNode, aError);
} else {
nsINode::AppendChild(*rowContent, aError);
}