From 7744edaa30431c50513554d60a608042e4f6c159 Mon Sep 17 00:00:00 2001 From: Vincent Sanders Date: Mon, 3 Oct 2011 08:51:57 +0000 Subject: add html objects in better order svn path=/trunk/netsurf/; revision=12923 --- render/html.c | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) (limited to 'render/html.c') diff --git a/render/html.c b/render/html.c index 4231b7bae..cb38ac2f9 100644 --- a/render/html.c +++ b/render/html.c @@ -1387,6 +1387,7 @@ bool html_fetch_object(html_content *c, const char *url, struct box *box, bool background) { struct content_html_object *object; + struct content_html_object *ins_object; /* the object to insert after */ char *url2; url_func_result res; @@ -1415,9 +1416,19 @@ bool html_fetch_object(html_content *c, const char *url, struct box *box, object->background = background; object->url = url2; - /* add to object list */ - object->next = c->object_list; - c->object_list = object; + /* add to content object list, this list determines fetch order */ + if (c->object_list == NULL) { + /* no other objects */ + object->next = c->object_list; + c->object_list = object; + } else { + /* insert at end */ + ins_object = c->object_list; + while (ins_object->next != NULL) { + ins_object = ins_object->next; + } + ins_object->next = object; + } c->num_objects++; -- cgit v1.2.3