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