From 58267e14fde3fe1ead0579e5517602d1482bde97 Mon Sep 17 00:00:00 2001 From: James Bursa Date: Mon, 30 Jun 2003 15:56:35 +0000 Subject: [project @ 2003-06-30 15:56:35 by bursa] Fix image loading when images are in the cache. svn path=/import/netsurf/; revision=191 --- render/html.c | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) (limited to 'render') 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); } -- cgit v1.2.3