return mControls->AddElementToTable(aChild, aName);
nsCOMPtr<nsISupports> supports; mNameLookupTable.Get(aName, getter_AddRefs(supports));  if (!supports) {  nsCOMPtr<nsISupports> child(do_QueryInterface(aChild));  NS_ENSURE_TRUE( mNameLookupTable.Put(aName, child), NS_ERROR_FAILURE ); } else {  nsCOMPtr<nsIContent> content(do_QueryInterface(supports)); nsCOMPtr<nsIContent> newChild(do_QueryInterface(aChild));  if (content) {     if (content == newChild) { return NS_OK; }    nsBaseContentList *list = new nsBaseContentList(); NS_ENSURE_TRUE(list, NS_ERROR_OUT_OF_MEMORY);  list->AppendElement(content);   list->AppendElement(newChild);  nsCOMPtr<nsISupports> listSupports = do_QueryInterface(list);   NS_ENSURE_TRUE(mNameLookupTable.Put(aName, listSupports), NS_ERROR_FAILURE); } else {  nsCOMPtr<nsIDOMNodeList> nodeList(do_QueryInterface(supports)); NS_ENSURE_TRUE(nodeList, NS_ERROR_FAILURE);   nsBaseContentList *list = NS_STATIC_CAST(nsBaseContentList *, (nsIDOMNodeList *)nodeList.get());  PRInt32 oldIndex = list->IndexOf(newChild, PR_FALSE);   if (oldIndex < 0) { list->AppendElement(newChild); } } }  return NS_OK;
nsHTMLFormElement::AddElementToTable(nsIFormControl* aChild,                                     const nsAString& aName){  NS_ENSURE_TRUE(mControls, NS_ERROR_UNEXPECTED);  return mControls->AddElementToTable(aChild, aName);  }