nsresult rv = NS_NewHTMLTableCellElement(&cellContent, nsHTMLAtoms::td);
nsCOMPtr<nsINodeInfo> nodeInfo; mInner.mNodeInfo->NameChanged(nsHTMLAtoms::td, *getter_AddRefs(nodeInfo));  nsresult rv = NS_NewHTMLTableCellElement(&cellContent, nodeInfo);
nsHTMLTableRowElement::InsertCell(PRInt32 aIndex, nsIDOMHTMLElement** aValue){  *aValue = nsnull;  PRInt32 refIndex = (0 <= aIndex) ? aIndex : 0;        nsCOMPtr<nsIDOMHTMLCollection> cells;  GetCells(getter_AddRefs(cells));  PRUint32 cellCount;  cells->GetLength(&cellCount);  PRBool doInsert = (aIndex < PRInt32(cellCount));    // create the cell  nsIHTMLContent* cellContent = nsnull;  nsresult rv = NS_NewHTMLTableCellElement(&cellContent, nsHTMLAtoms::td);  if (NS_SUCCEEDED(rv) && (nsnull != cellContent)) {    nsIDOMNode* cellNode = nsnull;    rv = cellContent->QueryInterface(kIDOMNodeIID, (void **)&cellNode);     if (NS_SUCCEEDED(rv) && (nsnull != cellNode)) {      if (doInsert) {        PRInt32 refIndex = PR_MAX(aIndex, 0);           nsCOMPtr<nsIDOMNode> refCell;        cells->Item(refIndex, getter_AddRefs(refCell));        rv = InsertBefore(cellNode, refCell, (nsIDOMNode **)aValue);      } else {        rv = AppendChild(cellNode, (nsIDOMNode **)aValue);      }      NS_RELEASE(cellNode);    }    NS_RELEASE(cellContent);  }    return NS_OK;}