Stop invalid background image URL from preventing page load.

Stops url(http://) from causing page load to fail with warning
message of "boxconvert".
This commit is contained in:
Michael Drake 2014-09-25 09:50:24 +01:00
parent e825f38437
commit c9bf72a4a3

View File

@ -930,7 +930,7 @@ bool box_construct_element(struct box_construct_ctx *ctx,
/* Kick off fetch for any background image */ /* Kick off fetch for any background image */
if (css_computed_background_image(box->style, &bgimage_uri) == if (css_computed_background_image(box->style, &bgimage_uri) ==
CSS_BACKGROUND_IMAGE_IMAGE && bgimage_uri != NULL && CSS_BACKGROUND_IMAGE_IMAGE && bgimage_uri != NULL &&
nsoption_bool(background_images) == true) { nsoption_bool(background_images) == true) {
nsurl *url; nsurl *url;
nserror error; nserror error;
@ -939,16 +939,17 @@ bool box_construct_element(struct box_construct_ctx *ctx,
* nsurl_joined it. Can this be improved? * nsurl_joined it. Can this be improved?
* For now, just making another nsurl. */ * For now, just making another nsurl. */
error = nsurl_create(lwc_string_data(bgimage_uri), &url); error = nsurl_create(lwc_string_data(bgimage_uri), &url);
if (error != NSERROR_OK) if (error == NSERROR_OK) {
return false; /* Fetch image if we got a valid URL */
if (html_fetch_object(ctx->content, url, box,
if (html_fetch_object(ctx->content, url, box, image_types, image_types,
ctx->content->base.available_width, 1000, ctx->content->base.available_width,
true) == false) { 1000, true) == false) {
nsurl_unref(url);
return false;
}
nsurl_unref(url); nsurl_unref(url);
return false;
} }
nsurl_unref(url);
} }
if (*convert_children) if (*convert_children)