if (retChild) { retChild->QueryInterface(NS_GET_IID(nsIDOMHTMLElement), (void **)aValue); } } }
rv = InsertBefore(rowNode, refRow, getter_AddRefs(retChild)); } else { rv = AppendChild(rowNode, getter_AddRefs(retChild)); }  if (retChild) { CallQueryInterface(retChild, aValue); }
nsHTMLTableSectionElement::InsertRow(PRInt32 aIndex,                                     nsIDOMHTMLElement** aValue){  *aValue = nsnull;  nsCOMPtr<nsIDOMHTMLCollection> rows;  GetRows(getter_AddRefs(rows));  PRUint32 rowCount;  rows->GetLength(&rowCount);  PRBool doInsert = (aIndex < PRInt32(rowCount));  // create the row  nsCOMPtr<nsIHTMLContent> rowContent;  nsCOMPtr<nsINodeInfo> nodeInfo;  mNodeInfo->NameChanged(nsHTMLAtoms::tr, *getter_AddRefs(nodeInfo));  nsresult rv = NS_NewHTMLTableRowElement(getter_AddRefs(rowContent),                                          nodeInfo);  if (NS_SUCCEEDED(rv) && rowContent) {    nsCOMPtr<nsIDOMNode> rowNode(do_QueryInterface(rowContent));    if (NS_SUCCEEDED(rv) && rowNode) {      nsCOMPtr<nsIDOMNode> retChild;      if (doInsert) {        PRInt32 refIndex = PR_MAX(aIndex, 0);           nsCOMPtr<nsIDOMNode> refRow;        rows->Item(refIndex, getter_AddRefs(refRow));        rv = InsertBefore(rowNode, refRow, getter_AddRefs(retChild));      } else {        rv = AppendChild(rowNode, getter_AddRefs(retChild));      }      if (retChild) {        retChild->QueryInterface(NS_GET_IID(nsIDOMHTMLElement),                                 (void **)aValue);      }    }  }   return NS_OK;}