summaryrefslogtreecommitdiff
path: root/render/html.c
diff options
context:
space:
mode:
authorJames Bursa <james@netsurf-browser.org>2003-06-30 15:56:35 +0000
committerJames Bursa <james@netsurf-browser.org>2003-06-30 15:56:35 +0000
commit58267e14fde3fe1ead0579e5517602d1482bde97 (patch)
treec256f78b30f3fb9ac9964b46cac9964b5a78f9bf /render/html.c
parent017fc4eb4b9f322ba36427ecb34853b93a41e62a (diff)
downloadnetsurf-58267e14fde3fe1ead0579e5517602d1482bde97.tar.gz
netsurf-58267e14fde3fe1ead0579e5517602d1482bde97.tar.bz2
[project @ 2003-06-30 15:56:35 by bursa]
Fix image loading when images are in the cache. svn path=/import/netsurf/; revision=191
Diffstat (limited to 'render/html.c')
-rw-r--r--render/html.c14
1 files changed, 8 insertions, 6 deletions
diff --git a/render/html.c b/render/html.c
index c9932f6a4..e8c2fd439 100644
--- a/render/html.c
+++ b/render/html.c
@@ -357,8 +357,10 @@ void html_fetch_object(struct content *c, char *url, struct box *box)
c->data.html.object[i].content = fetchcache(url, c->url,
html_object_callback,
c, i, 0, 0);
- if (c->data.html.object[i].content->status != CONTENT_STATUS_DONE)
- c->active++;
+ c->active++;
+ if (c->data.html.object[i].content->status == CONTENT_STATUS_DONE)
+ html_object_callback(CONTENT_MSG_DONE,
+ c->data.html.object[i].content, c, i, 0);
c->data.html.object_count++;
}
@@ -436,6 +438,7 @@ void html_object_callback(content_msg msg, struct content *object,
case CONTENT_MSG_STATUS:
sprintf(c->status_message, "Loading %i objects: %s",
c->active, object->status_message);
+ content_broadcast(c, CONTENT_MSG_STATUS, 0);
break;
case CONTENT_MSG_REDIRECT:
@@ -454,15 +457,14 @@ void html_object_callback(content_msg msg, struct content *object,
}
LOG(("%i active", c->active));
- if (c->active == 0) {
+ if (c->status == CONTENT_STATUS_READY && c->active == 0) {
/* all objects have arrived */
content_reformat(c, c->available_width, 0);
c->status = CONTENT_STATUS_DONE;
+ sprintf(c->status_message, "Document done");
content_broadcast(c, CONTENT_MSG_DONE, 0);
}
- if (c->active == 0)
- sprintf(c->status_message, "Document done");
- else
+ if (c->status == CONTENT_STATUS_READY)
sprintf(c->status_message, "Loading %i objects", c->active);
}