diff options
Diffstat (limited to 'render')
-rw-r--r-- | render/html.c | 41 | ||||
-rw-r--r-- | render/html.h | 1 |
2 files changed, 37 insertions, 5 deletions
diff --git a/render/html.c b/render/html.c index 827660add..a96869313 100644 --- a/render/html.c +++ b/render/html.c @@ -668,15 +668,15 @@ void html_object_callback(content_msg msg, struct content *object, case CONTENT_MSG_REDRAW: box_coords(box, &x, &y); - if (box->object == data.redraw.object) { + if (object == data.redraw.object) { data.redraw.x = data.redraw.x * - box->width / box->object->width; + box->width / object->width; data.redraw.y = data.redraw.y * - box->height / box->object->height; + box->height / object->height; data.redraw.width = data.redraw.width * - box->width / box->object->width; + box->width / object->width; data.redraw.height = data.redraw.height * - box->height / box->object->height; + box->height / object->height; data.redraw.object_width = box->width; data.redraw.object_height = box->height; } @@ -772,6 +772,37 @@ bool html_object_type_permitted(const content_type type, /** + * Stop loading a CONTENT_HTML in state READY. + */ + +void html_stop(struct content *c) +{ + unsigned int i; + struct content *object; + + assert(c->status == CONTENT_STATUS_READY); + + for (i = 0; i != c->data.html.object_count; i++) { + object = c->data.html.object[i].content; + if (!object) + continue; + + if (object->status == CONTENT_STATUS_DONE) + ; /* already loaded: do nothing */ + else if (object->status == CONTENT_STATUS_READY) + content_stop(object, html_object_callback, + c, (void *) i); + else { + content_remove_user(c->data.html.object[i].content, + html_object_callback, c, (void *) i); + c->data.html.object[i].content = 0; + } + } + c->status = CONTENT_STATUS_DONE; +} + + +/** * Reformat a CONTENT_HTML to a new width. */ diff --git a/render/html.h b/render/html.h index 9580beacb..6d9ad8b80 100644 --- a/render/html.h +++ b/render/html.h @@ -92,6 +92,7 @@ void html_fetch_object(struct content *c, char *url, struct box *box, const content_type *permitted_types, int available_width, int available_height, bool background); +void html_stop(struct content *c); /* in riscos/htmlinstance.c */ void html_add_instance(struct content *c, struct browser_window *bw, |