mirror of
https://github.com/netsurf-browser/netsurf
synced 2025-01-13 06:19:21 +03:00
remove unused available width and height parameters from html_fecth_object()
This commit is contained in:
parent
6b6bbad2b7
commit
479d0cb29a
@ -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;
|
||||
}
|
||||
|
@ -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;
|
||||
|
@ -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;
|
||||
|
@ -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);
|
||||
|
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user