Gitweb links:
...log
http://git.netsurf-browser.org/netsurf.git/shortlog/c9bf72a4a30da996fc84e...
...commit
http://git.netsurf-browser.org/netsurf.git/commit/c9bf72a4a30da996fc84ee6...
...tree
http://git.netsurf-browser.org/netsurf.git/tree/c9bf72a4a30da996fc84ee6df...
The branch, master has been updated
via c9bf72a4a30da996fc84ee6df8416a3e929ad28f (commit)
from e825f384370ec0c939f5b2c8d741b796b3eb98e9 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commitdiff
http://git.netsurf-browser.org/netsurf.git/commit/?id=c9bf72a4a30da996fc8...
commit c9bf72a4a30da996fc84ee6df8416a3e929ad28f
Author: Michael Drake <tlsa(a)netsurf-browser.org>
Commit: Michael Drake <tlsa(a)netsurf-browser.org>
Stop invalid background image URL from preventing page load.
Stops url(http://) from causing page load to fail with warning
message of "boxconvert".
diff --git a/render/box_construct.c b/render/box_construct.c
index 17cb330..9759d74 100644
--- a/render/box_construct.c
+++ b/render/box_construct.c
@@ -930,7 +930,7 @@ bool box_construct_element(struct box_construct_ctx *ctx,
/* Kick off fetch for any background image */
if (css_computed_background_image(box->style, &bgimage_uri) ==
CSS_BACKGROUND_IMAGE_IMAGE && bgimage_uri != NULL &&
- nsoption_bool(background_images) == true) {
+ nsoption_bool(background_images) == true) {
nsurl *url;
nserror error;
@@ -939,16 +939,17 @@ bool box_construct_element(struct box_construct_ctx *ctx,
* nsurl_joined it. Can this be improved?
* For now, just making another nsurl. */
error = nsurl_create(lwc_string_data(bgimage_uri), &url);
- if (error != NSERROR_OK)
- return false;
-
- if (html_fetch_object(ctx->content, url, box, image_types,
- ctx->content->base.available_width, 1000,
- true) == false) {
+ if (error == NSERROR_OK) {
+ /* Fetch image if we got a valid URL */
+ if (html_fetch_object(ctx->content, url, box,
+ image_types,
+ ctx->content->base.available_width,
+ 1000, true) == false) {
+ nsurl_unref(url);
+ return false;
+ }
nsurl_unref(url);
- return false;
}
- nsurl_unref(url);
}
if (*convert_children)
-----------------------------------------------------------------------
Summary of changes:
render/box_construct.c | 19 ++++++++++---------
1 files changed, 10 insertions(+), 9 deletions(-)
diff --git a/render/box_construct.c b/render/box_construct.c
index 17cb330..9759d74 100644
--- a/render/box_construct.c
+++ b/render/box_construct.c
@@ -930,7 +930,7 @@ bool box_construct_element(struct box_construct_ctx *ctx,
/* Kick off fetch for any background image */
if (css_computed_background_image(box->style, &bgimage_uri) ==
CSS_BACKGROUND_IMAGE_IMAGE && bgimage_uri != NULL &&
- nsoption_bool(background_images) == true) {
+ nsoption_bool(background_images) == true) {
nsurl *url;
nserror error;
@@ -939,16 +939,17 @@ bool box_construct_element(struct box_construct_ctx *ctx,
* nsurl_joined it. Can this be improved?
* For now, just making another nsurl. */
error = nsurl_create(lwc_string_data(bgimage_uri), &url);
- if (error != NSERROR_OK)
- return false;
-
- if (html_fetch_object(ctx->content, url, box, image_types,
- ctx->content->base.available_width, 1000,
- true) == false) {
+ if (error == NSERROR_OK) {
+ /* Fetch image if we got a valid URL */
+ if (html_fetch_object(ctx->content, url, box,
+ image_types,
+ ctx->content->base.available_width,
+ 1000, true) == false) {
+ nsurl_unref(url);
+ return false;
+ }
nsurl_unref(url);
- return false;
}
- nsurl_unref(url);
}
if (*convert_children)
--
NetSurf Browser