nsElementMap::Add(nsIRDFResource* aResource, nsIContent* aContent)
nsElementMap::Add(const nsAString& aID, nsIContent* aContent)
nsElementMap::Add(nsIRDFResource* aResource, nsIContent* aContent){    NS_PRECONDITION(mResources != nsnull, "not initialized");    if (! mResources)        return NS_ERROR_NOT_INITIALIZED;    ContentListItem* head =        (ContentListItem*) PL_HashTableLookup(mResources, aResource);    if (! head) {        head = new ContentListItem(aContent);        if (! head)            return NS_ERROR_OUT_OF_MEMORY;        PL_HashTableAdd(mResources, aResource, head);        NS_ADDREF(aResource);        NS_ADDREF(aContent);    }    else {        while (1) {            if (head->mContent == aContent) {                NS_ERROR("attempt to add same element twice");                return NS_ERROR_ILLEGAL_VALUE;            }            if (! head->mNext)                break;            head = head->mNext;        }        head->mNext = new ContentListItem(aContent);        if (! head->mNext)            return NS_ERROR_OUT_OF_MEMORY;        NS_ADDREF(aContent);    }    return NS_OK;}