rv = NS_NewHTMLTableCaptionElement(getter_AddRefs(newCaption),nsHTMLAtoms::caption);
nsCOMPtr<nsINodeInfo> nodeInfo; mInner.mNodeInfo->NameChanged(nsHTMLAtoms::caption, *getter_AddRefs(nodeInfo));  rv = NS_NewHTMLTableCaptionElement(getter_AddRefs(newCaption),nodeInfo);
nsHTMLTableElement::CreateCaption(nsIDOMHTMLElement** aValue){  *aValue = nsnull;  nsresult rv = NS_OK;  nsCOMPtr<nsIDOMHTMLTableCaptionElement> caption;  GetCaption(getter_AddRefs(caption));  if (caption)  { // return the existing thead    caption->QueryInterface(kIDOMHTMLElementIID, (void **)aValue);  // caller's addref    NS_ASSERTION(nsnull!=*aValue, "caption must be a DOMHTMLElement");  }  else  { // create a new head rowgroup    nsCOMPtr<nsIHTMLContent> newCaption;    rv = NS_NewHTMLTableCaptionElement(getter_AddRefs(newCaption),nsHTMLAtoms::caption);    if (NS_SUCCEEDED(rv) && newCaption)    {      rv = mInner.AppendChildTo(newCaption, PR_TRUE);      newCaption->QueryInterface(kIDOMHTMLElementIID, (void **)aValue); // caller's addref    }  }  return NS_OK;}