NS_FORWARD_NSIDOMNODE_NO_CLONENODE(nsGenericElement::)
nsXULElement::ReplaceChild(nsIDOMNode* aNewChild, nsIDOMNode* aOldChild, nsIDOMNode** aReturn) { NS_PRECONDITION(aNewChild != nsnull, "null ptr"); if (! aNewChild) return NS_ERROR_NULL_POINTER;  NS_PRECONDITION(aOldChild != nsnull, "null ptr"); if (! aOldChild) return NS_ERROR_NULL_POINTER;  nsresult rv;  nsCOMPtr<nsIContent> oldelement = do_QueryInterface(aOldChild); NS_ASSERTION(oldelement != nsnull, "not an nsIContent");  if (oldelement) { PRInt32 pos; rv = IndexOf(oldelement, pos); NS_ASSERTION(NS_SUCCEEDED(rv), "unable to determine index of aOldChild");  if (NS_SUCCEEDED(rv) && (pos >= 0)) { nsCOMPtr<nsIContent> newelement = do_QueryInterface(aNewChild); NS_ASSERTION(newelement != nsnull, "not an nsIContent");  if (newelement) { rv = ReplaceChildAt(newelement, pos, PR_TRUE); NS_ASSERTION(NS_SUCCEEDED(rv), "unable to replace old child"); } } }  NS_ADDREF(aNewChild); *aReturn = aNewChild; return NS_OK; }
    NS_FORWARD_NSIDOMNODE_NO_CLONENODE(nsGenericElement::)