doc->ContentRemoved(this, oldKid, aIndex);
doc->ContentRemoved(NS_STATIC_CAST(nsIStyledContent*, this), oldKid, aIndex);
RDFElementImpl::RemoveChildAt(PRInt32 aIndex, PRBool aNotify){    nsresult rv;    if (NS_FAILED(rv = EnsureContentsGenerated()))        return rv;    NS_PRECONDITION(mChildren != nsnull, "illegal value");    if (! mChildren)        return NS_ERROR_ILLEGAL_VALUE;    nsIContent* oldKid = (nsIContent *)mChildren->ElementAt(aIndex);    if (nsnull != oldKid ) {        nsIDocument* doc = mDocument;        PRBool rv = mChildren->RemoveElementAt(aIndex);        //nsRange::OwnerChildRemoved(this, aIndex, oldKid);        if (aNotify) {            if (nsnull != doc) {                doc->ContentRemoved(this, oldKid, aIndex);            }        }        oldKid->SetDocument(nsnull, PR_TRUE);        oldKid->SetParent(nsnull);        NS_RELEASE(oldKid);    }    return NS_OK;}