} else {
else #endif
il_get_container(IL_GroupContext *img_cx,                     ImgCachePolicy cache_reload_policy,                 const char *image_url,                 IL_IRGB *background_color,                 IL_DitherMode dither_mode,                 int req_depth,                 int req_width,  /* Target width requested by client. */                 int req_height) /* Target height requested by client. */{    PRUint32 urlhash, hash;    il_container *ic=NULL;    PRBool isChromeAlready = PR_FALSE;        urlhash = hash = il_hash(image_url);    /*     * Take into account whether color rendering preferences have     * changed since the image was cached.     */    hash += 21117 * (int)dither_mode;               /* Check the cache */    ic = il_find_in_cache(img_cx->display_type, hash, image_url,                          background_color, req_depth, req_width, req_height);    if (ic) {        	ILTRACE(2,("il:  il_get_container: found ic=0x%08x in cache for url %s\n", ic, image_url));        /* This ic is being destroyed. Need a new one */        if ((ic->state == IC_ABORT_PENDING))            ic = NULL;        /* Check if we have to reload or if there's an expiration date   */        /* and we've expired or if this is a JavaScript generated image. */        /* We don't want to cache JavaScript generated images because:   */        /* 1) The assumption is that they are generated and might change */        /*    if the page is reloaded.                                   */        /* 2) Their namespace crosses document boundaries, so caching    */        /*    could result in incorrect behavior.                        */	// if it is chrome, record that fact, and ensure it is not purged        if(cache_reload_policy == DONT_USE_IMG_CACHE && ic->moz_type != TYPE_CHROME){		ILTRACE(2,("il:  il_get_container: DONT_USE_IMG_CACHE ic=0x%08x discarding\n", ic));             /* Don't use old copy and purge it from cache.*/            	if (!ic->is_in_use) {                	il_removefromcache(ic);                	il_delete_container(ic);            	}            	ic = NULL;        }    }#ifdef PIN_CHROME    /* Reorder the cache list so it remains in LRU order*/    if (ic && ic->moz_type != TYPE_CHROME)        il_removefromcache(ic);    else if (ic && ic->moz_type == TYPE_CHROME)	    isChromeAlready = PR_TRUE;#else    if(ic)        il_removefromcache(ic);#endif    /* There's no existing matching container.  Make a new one. */    if (!ic) {        ic = PR_NEWZAP(il_container);        if (!ic)            return NULL;        /* Allocate the source image header. */        if (!(ic->src_header = PR_NEWZAP(NI_PixmapHeader))) {            PR_FREEIF(ic);            return NULL;        }        /* Allocate the source image's colorspace.  The fields will be           filled in by the image decoder. */        if (!(ic->src_header->color_space = PR_NEWZAP(IL_ColorSpace))) {            PR_FREEIF(ic->src_header);            PR_FREEIF(ic);            return NULL;        }        IL_AddRefToColorSpace(ic->src_header->color_space);        /* Allocate the destination image structure.  A destination mask           structure will be allocated later if the image is determined to           be transparent and no background_color has been provided. */    	if (!(ic->image = PR_NEWZAP(IL_Pixmap))) {            IL_ReleaseColorSpace(ic->src_header->color_space);            PR_FREEIF(ic->src_header);            PR_FREEIF(ic);            return NULL;        }                /* Set the destination image colorspace to be the source image's           colorspace.  The Front Ends can override this with the display           colorspace. */        ic->image->header.color_space = ic->src_header->color_space;        IL_AddRefToColorSpace(ic->image->header.color_space);        /* Clear the flag to indicate that this is not a mask */        ic->image->header.is_mask = PR_FALSE;        /* Save the requested background color in the container. */        if (background_color) {            if (!(ic->background_color = PR_NEWZAP(IL_IRGB))) {                PR_FREEIF(ic->image);                IL_ReleaseColorSpace(ic->src_header->color_space);                IL_ReleaseColorSpace(ic->image->header.color_space);                PR_FREEIF(ic->src_header);                PR_FREEIF(ic);                return NULL;            }            nsCRT::memcpy(ic->background_color, background_color, sizeof(IL_IRGB));        }        else {            ic->background_color = NULL;        }        ILTRACE(2, ("il: create ic=0x%08x\n", ic));        if (nsCRT::strncmp(image_url,"chrome", 6) == 0) {		    ic->moz_type = TYPE_CHROME;    	}	    else {		    ic->moz_type = TYPE_DEFAULT;	    }        ic->hash = hash;        ic->urlhash = urlhash;        ic->url_address = nsCRT::strdup(image_url);        ic->is_url_loading = PR_FALSE;        ic->dest_width  = req_width;        ic->dest_height = req_height;        /* The image context is saved for use during decoding only. */        ic->img_cx = img_cx;             /* The type of display for which this image is being decoded e.g.           screen, printer, postscript. */        ic->display_type = img_cx->display_type;        /* Certain callbacks, like DestroyPixmap, can be invoked after the           image context has been destroyed, so we hold on to the callback           interface and increment its reference count.  The reference count           is decremented when the container is destroyed. */        ic->img_cb = img_cx->img_cb;        NS_ADDREF(ic->img_cb);        /* callbacks for the  image decoders */        ImgDCallbk* imgdcb = new ImgDCallbk(ic);        if (!imgdcb) {          PR_FREEIF(ic->image);          IL_ReleaseColorSpace(ic->src_header->color_space);          IL_ReleaseColorSpace(ic->image->header.color_space);          PR_FREEIF(ic->src_header);          nsCRT::free(ic->url_address);          PR_FREEIF(ic);          return NULL;        }        nsresult res = imgdcb->QueryInterface(kIImgDCallbkIID, (void**)&imgdcb);        if (NS_FAILED(res)) {          delete imgdcb;                   PR_FREEIF(ic->image);          IL_ReleaseColorSpace(ic->src_header->color_space);          IL_ReleaseColorSpace(ic->image->header.color_space);          PR_FREEIF(ic->src_header);          nsCRT::free(ic->url_address);          PR_FREEIF(ic);          return NULL;        }        imgdcb->SetContainer(ic);        ic->imgdcb = imgdcb;    }#ifdef PIN_CHROME    if ( isChromeAlready == PR_FALSE )  // image is new, or existing and type is				 // not TYPE_CHROME#endif	    il_addtocache(ic);    ic->is_in_use = PR_TRUE;        return ic;}