From 479d0cb29a74eddc95e3e2292d9d49e8dafdf46f Mon Sep 17 00:00:00 2001 From: Vincent Sanders Date: Thu, 30 Apr 2020 22:16:41 +0100 Subject: remove unused available width and height parameters from html_fecth_object() --- content/handlers/html/box_construct.c | 17 ++++++++++------- content/handlers/html/box_special.c | 23 +++++++++++------------ content/handlers/html/html.c | 2 +- content/handlers/html/html_internal.h | 7 +------ content/handlers/html/object.c | 22 ++++++++++++++-------- 5 files changed, 37 insertions(+), 34 deletions(-) (limited to 'content') diff --git a/content/handlers/html/box_construct.c b/content/handlers/html/box_construct.c index 1637c0fb1..fba97641d 100644 --- a/content/handlers/html/box_construct.c +++ b/content/handlers/html/box_construct.c @@ -470,9 +470,11 @@ box_construct_marker(struct box *box, if (error != NSERROR_OK) return false; - if (html_fetch_object(ctx->content, url, marker, image_types, - ctx->content->base.available_width, 1000, false) == - false) { + if (html_fetch_object(ctx->content, + url, + marker, + image_types, + false) == false) { nsurl_unref(url); return false; } @@ -705,10 +707,11 @@ box_construct_element(struct box_construct_ctx *ctx, bool *convert_children) error = nsurl_create(lwc_string_data(bgimage_uri), &url); 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) { + if (html_fetch_object(ctx->content, + url, + box, + image_types, + true) == false) { nsurl_unref(url); return false; } diff --git a/content/handlers/html/box_special.c b/content/handlers/html/box_special.c index 38031ceb1..9f4a51201 100644 --- a/content/handlers/html/box_special.c +++ b/content/handlers/html/box_special.c @@ -956,8 +956,7 @@ box_embed(dom_node *n, /* start fetch */ box->flags |= IS_REPLACED; - return html_fetch_object(content, params->data, box, CONTENT_ANY, - content->base.available_width, 1000, false); + return html_fetch_object(content, params->data, box, CONTENT_ANY, false); } @@ -1189,8 +1188,7 @@ box_image(dom_node *n, /* start fetch */ box->flags |= IS_REPLACED; - ok = html_fetch_object(content, url, box, image_types, - content->base.available_width, 1000, false); + ok = html_fetch_object(content, url, box, image_types, false); nsurl_unref(url); wtype = css_computed_width(box->style, &value, &wunit); @@ -1332,11 +1330,11 @@ box_input(dom_node *n, */ if (nsurl_compare(url, content->base_url, NSURL_COMPLETE) == false) { - if (!html_fetch_object(content, url, - box, image_types, - content->base. - available_width, - 1000, false)) { + if (!html_fetch_object(content, + url, + box, + image_types, + false)) { nsurl_unref(url); goto no_memory; } @@ -1613,9 +1611,10 @@ box_object(dom_node *n, /* start fetch (MIME type is ok or not specified) */ box->flags |= IS_REPLACED; if (!html_fetch_object(content, - params->data ? params->data : params->classid, - box, CONTENT_ANY, content->base.available_width, 1000, - false)) + params->data ? params->data : params->classid, + box, + CONTENT_ANY, + false)) return false; *convert_children = false; diff --git a/content/handlers/html/html.c b/content/handlers/html/html.c index 01244cc35..72305266c 100644 --- a/content/handlers/html/html.c +++ b/content/handlers/html/html.c @@ -687,7 +687,7 @@ static bool html_process_img(html_content *c, dom_node *node) dom_string_unref(src); /* Speculatively fetch the image */ - success = html_fetch_object(c, url, NULL, CONTENT_IMAGE, 0, 0, false); + success = html_fetch_object(c, url, NULL, CONTENT_IMAGE, false); nsurl_unref(url); return success; diff --git a/content/handlers/html/html_internal.h b/content/handlers/html/html_internal.h index d9810177b..6b5533492 100644 --- a/content/handlers/html/html_internal.h +++ b/content/handlers/html/html_internal.h @@ -376,15 +376,10 @@ nserror html_css_fetcher_add_item(dom_string *data, nsurl *base_url, * \param url URL of object to fetch (copied) * \param box box that will contain the object * \param permitted_types bitmap of acceptable types - * \param available_width estimate of width of object - * \param available_height estimate of height of object * \param background this is a background image * \return true on success, false on memory exhaustion */ -bool html_fetch_object(html_content *c, nsurl *url, struct box *box, - content_type permitted_types, - int available_width, int available_height, - bool background); +bool html_fetch_object(html_content *c, nsurl *url, struct box *box, content_type permitted_types, bool background); nserror html_object_free_objects(html_content *html); nserror html_object_close_objects(html_content *html); diff --git a/content/handlers/html/object.c b/content/handlers/html/object.c index 587c48756..c20118d69 100644 --- a/content/handlers/html/object.c +++ b/content/handlers/html/object.c @@ -677,10 +677,12 @@ nserror html_object_free_objects(html_content *html) /* exported interface documented in html/html_internal.h */ -bool html_fetch_object(html_content *c, nsurl *url, struct box *box, - content_type permitted_types, - int available_width, int available_height, - bool background) +bool +html_fetch_object(html_content *c, + nsurl *url, + struct box *box, + content_type permitted_types, + bool background) { struct content_html_object *object; hlcache_child_context child; @@ -706,10 +708,14 @@ bool html_fetch_object(html_content *c, nsurl *url, struct box *box, object->background = background; error = hlcache_handle_retrieve(url, - HLCACHE_RETRIEVE_SNIFF_TYPE, - content_get_url(&c->base), NULL, - html_object_callback, object, &child, - object->permitted_types, &object->content); + HLCACHE_RETRIEVE_SNIFF_TYPE, + content_get_url(&c->base), + NULL, + html_object_callback, + object, + &child, + object->permitted_types, + &object->content); if (error != NSERROR_OK) { free(object); return error != NSERROR_NOMEM; -- cgit v1.2.3