nsGenericHTMLContainerElement::InsertChildAt(nsIContent* aKid, PRInt32 aIndex, PRBool aNotify, PRBool aDeepSetDocument) { NS_PRECONDITION(nsnull != aKid, "null ptr"); nsIDocument* doc = mDocument; if (aNotify && (nsnull != doc)) { doc->BeginUpdate();
NS_IMETHOD InsertChildAt(nsIContent* aKid, PRInt32 aIndex, PRBool aNotify, PRBool aDeepSetDocument) { return NS_OK;
nsGenericHTMLContainerElement::InsertChildAt(nsIContent* aKid,                                             PRInt32 aIndex,                                             PRBool aNotify,                                             PRBool aDeepSetDocument){  NS_PRECONDITION(nsnull != aKid, "null ptr");  nsIDocument* doc = mDocument;  if (aNotify && (nsnull != doc)) {    doc->BeginUpdate();  }  PRBool rv = mChildren.InsertElementAt(aKid, aIndex);/* XXX fix up void array api to use nsresult's*/  if (rv) {    NS_ADDREF(aKid);    aKid->SetParent(this);    nsRange::OwnerChildInserted(this, aIndex);    if (nsnull != doc) {      aKid->SetDocument(doc, aDeepSetDocument, PR_TRUE);      if (aNotify) {        doc->ContentInserted(this, aKid, aIndex);      }      if (nsGenericElement::HasMutationListeners(this, NS_EVENT_BITS_MUTATION_NODEINSERTED)) {        nsCOMPtr<nsIDOMEventTarget> node(do_QueryInterface(aKid));        nsMutationEvent mutation;        mutation.eventStructType = NS_MUTATION_EVENT;        mutation.message = NS_MUTATION_NODEINSERTED;        mutation.mTarget = node;        nsCOMPtr<nsIDOMNode> relNode(do_QueryInterface(NS_STATIC_CAST(nsIContent *, this)));        mutation.mRelatedNode = relNode;        nsEventStatus status = nsEventStatus_eIgnore;        aKid->HandleDOMEvent(nsnull, &mutation, nsnull, NS_EVENT_FLAG_INIT, &status);      }    }  }  if (aNotify && (nsnull != doc)) {    doc->EndUpdate();  }  return NS_OK;}