summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVincent Sanders <vince@netsurf-browser.org>2011-10-03 08:51:57 +0000
committerVincent Sanders <vince@netsurf-browser.org>2011-10-03 08:51:57 +0000
commit7744edaa30431c50513554d60a608042e4f6c159 (patch)
tree9b6bbfa725d23c8d25b6d36496eb3f93c875a776
parent602c2502e7c747496fb4ac39db52ba14f8c1dee6 (diff)
downloadnetsurf-7744edaa30431c50513554d60a608042e4f6c159.tar.gz
netsurf-7744edaa30431c50513554d60a608042e4f6c159.tar.bz2
add html objects in better order
svn path=/trunk/netsurf/; revision=12923
-rw-r--r--render/html.c17
1 files changed, 14 insertions, 3 deletions
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++;