nsIDOMNodeList *kids=nsnull; nsAutoString theadAsString; nsHTMLAtoms::thead->ToString(theadAsString); nsresult rv = mInner.GetElementsByTagName(theadAsString, &kids); if ((NS_SUCCEEDED(rv)) && (nsnull!=kids))
nsCOMPtr<nsIDOMNode> child; mInner.GetFirstChild(getter_AddRefs(child)); while (child)
nsHTMLTableElement::GetTHead(nsIDOMHTMLTableSectionElement** aValue){  /* this is a better implementation, but GetElementsByTagName isn't implemented yet */  /*  *aValue = nsnull;  nsIDOMNodeList *kids=nsnull;  nsAutoString theadAsString;  nsHTMLAtoms::thead->ToString(theadAsString);  nsresult rv = mInner.GetElementsByTagName(theadAsString, &kids);  if ((NS_SUCCEEDED(rv)) && (nsnull!=kids))  {    nsIDOMNode *thead=nsnull;    rv = kids->Item(0, &thead);    if (NS_SUCCEEDED(rv))      *aValue = (nsIDOMHTMLTableSectionElement*)thead;  }  */  *aValue = nsnull;  nsIDOMNode* child=nsnull;  mInner.GetFirstChild(&child);  while (nsnull!=child)  {    nsIDOMHTMLTableSectionElement *section=nsnull;    nsresult rv = child->QueryInterface(kIDOMHTMLTableSectionElementIID, (void**)&section);    if ((NS_SUCCEEDED(rv)) && (nsnull!=section))    {      nsString tag;      section->GetTagName(tag);      nsAutoString theadAsString;      nsHTMLAtoms::thead->ToString(theadAsString);      if (theadAsString==tag)      {        *aValue = section;        break;      }    }    child->GetNextSibling(&child);  }  return NS_OK;}