XULDocumentImpl::RemoveElementFromMap(nsIContent* aElement, PRBool aDeep)
XULDocumentImpl::RemoveElementFromMap(nsIContent* aElement)
XULDocumentImpl::RemoveElementFromMap(nsIContent* aElement, PRBool aDeep){    nsresult rv;    PRInt32 nameSpaceID;    rv = aElement->GetNameSpaceID(nameSpaceID);    if (NS_FAILED(rv)) return rv;    if (nameSpaceID == kNameSpaceID_HTML) {        for (PRInt32 i = 0; kIdentityAttrs[i] != nsnull; ++i) {            nsAutoString value;            rv = aElement->GetAttribute(kNameSpaceID_None, *kIdentityAttrs[i], value);            NS_ASSERTION(NS_SUCCEEDED(rv), "unable to get attribute");            if (NS_FAILED(rv)) return rv;            if (rv == NS_CONTENT_ATTR_HAS_VALUE) {                nsCOMPtr<nsIRDFResource> resource;                rv = gXULUtils->MakeElementResource(this, value, getter_AddRefs(resource));                rv = mResources.Remove(resource, aElement);                if (NS_FAILED(rv)) return rv;            }        }    }    if (aDeep) {        PRInt32 count;        nsCOMPtr<nsIXULContent> xulcontent = do_QueryInterface(aElement);        rv = xulcontent ? xulcontent->PeekChildCount(count) : aElement->ChildCount(count);        if (NS_FAILED(rv)) return rv;        while (--count > 0) {            nsCOMPtr<nsIContent> child;            rv = aElement->ChildAt(count, *getter_AddRefs(child));            if (NS_FAILED(rv)) return rv;            rv = RemoveElementFromMap(child, PR_TRUE);            if (NS_FAILED(rv)) return rv;        }    }    return NS_OK;}