CL_Layer *parent_layer)
CL_Layer *parent_layer, int16 table_nesting_level)
lo_CreateCellBackgroundLayer(MWContext *context, LO_CellStruct *cell,                             CL_Layer *parent_layer){    CL_Layer *cellbg_layer;    XP_Rect bbox;    lo_BackgroundLayerClosure *closure;        CL_LayerVTable vtable;    int32 layer_x_offset, layer_y_offset;    int32 parent_x_shift, parent_y_shift;            /* The layer is the size of the cell */    bbox.left   = 0;    bbox.top    = 0;    bbox.right  = cell->width;    bbox.bottom = cell->height;    lo_GetLayerXYShift(parent_layer, &parent_x_shift, &parent_y_shift);    layer_x_offset = cell->x + cell->x_offset - parent_x_shift;    layer_y_offset = cell->y + cell->y_offset - parent_y_shift;        /* Create the client_data */    closure = XP_NEW_ZAP(lo_BackgroundLayerClosure);    closure->type = LO_HTML_BACKGROUND_LAYER;    closure->context = context;     closure->bg_type = BG_CELL;    closure->tile_mode = cell->backdrop.tile_mode;    closure->cell = cell;       XP_BZERO(&vtable, sizeof(CL_LayerVTable));        vtable.painter_func = lo_background_painter_func;    vtable.destroy_func = lo_cellbg_destroy_func;    cellbg_layer = CL_NewLayer(NULL, layer_x_offset, layer_y_offset,                               &bbox, &vtable,                               CL_HIDDEN | CL_DONT_ENUMERATE,                                (void *)closure);    if (!cellbg_layer)        return NULL;    CL_InsertChildByZ(parent_layer, cellbg_layer, Z_CELL_BACKGROUND_LAYER);    /* Start loading tiled cell backdrop image, if present */    if (cell->backdrop.url && *cell->backdrop.url) {        LO_ImageStruct *image;        image = lo_get_background_layer_image(cellbg_layer, PR_TRUE);        if (image) {            lo_TopState *top_state = lo_get_layer_top_state(parent_layer);            char *url = NET_MakeAbsoluteURL(top_state->base_url, cell->backdrop.url);            if (url) {                XP_FREE(cell->backdrop.url);                cell->backdrop.url = url;				/* Note: In the case of nested tables with background				images, the image request is destroyed before the table				relayout and will not exist in the cache. Changing reload				policy if it is NET_CACHE_ONLY_RELOAD to NET_DONT_RELOAD				allows loading the image again from a file if it has 				been removed from the cache.				Trying to use the trash list would cause memory leaks				as the trash list removes items from the mem arena. Allocating				the image_request by taking it from the arena (instead of				explicitly allocating it) could cause problems in				the editor code.				*/	                LO_SetImageURL(context, context->img_cx, image, url,					   ((top_state->force_reload == NET_CACHE_ONLY_RELOAD)?									NET_DONT_RELOAD : top_state->force_reload));				XP_FREE(url);            }        }    }    /* Set cell background color, if the cell isn't transparent. */    if (cell->backdrop.bg_color) {	if (UserOverride)	    lo_set_background_layer_bgcolor(cellbg_layer, &lo_master_colors[LO_COLOR_BG]);	else            lo_set_background_layer_bgcolor(cellbg_layer, cell->backdrop.bg_color);    }    return cellbg_layer;}