return mControls->AddElementToTable(aChild, aName);
nsStringKey key(aName);  nsCOMPtr<nsISupports> supports; supports = dont_AddRef(mNameLookupTable.Get(&key));  if (!supports) {  nsCOMPtr<nsISupports> child(do_QueryInterface(aChild));  mNameLookupTable.Put(&key, child); } 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);   mNameLookupTable.Put(&key, listSupports); } 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 = -1; list->IndexOf(newChild, oldIndex);   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);  }