From bc533957fd8833976d8558a98b0e81d3f62cbe2e Mon Sep 17 00:00:00 2001 From: John Mark Bell Date: Tue, 29 Jun 2004 19:08:19 +0000 Subject: [project @ 2004-06-29 19:08:19 by jmb] Full reload support for HTML contents. Adjust click the reload button svn path=/import/netsurf/; revision=1029 --- desktop/browser.c | 19 ++++++++++++++++++- desktop/browser.h | 2 +- 2 files changed, 19 insertions(+), 2 deletions(-) (limited to 'desktop') diff --git a/desktop/browser.c b/desktop/browser.c index 31daaf379..6de46c293 100644 --- a/desktop/browser.c +++ b/desktop/browser.c @@ -409,13 +409,30 @@ void browser_window_stop(struct browser_window *bw) * Reload the page in a browser window. * * \param bw browser window + * \param all whether to reload all objects associated with the page */ -void browser_window_reload(struct browser_window *bw) +void browser_window_reload(struct browser_window *bw, bool all) { + struct content *c; + unsigned int i; + if (!bw->current_content || bw->loading_content) return; + if (all && bw->current_content->type == CONTENT_HTML) { + c = bw->current_content; + /* invalidate objects */ + for (i=0; i!=c->data.html.object_count; i++) { + if (c->data.html.object[i].content != 0) + c->data.html.object[i].content->fresh = false; + } + /* invalidate stylesheets */ + for (i=2; i!=c->data.html.stylesheet_count; i++) { + if (c->data.html.stylesheet_content[i] != 0) + c->data.html.stylesheet_content[i]->fresh = false; + } + } bw->current_content->fresh = false; browser_window_go_post(bw, bw->current_content->url, 0, 0, false); } diff --git a/desktop/browser.h b/desktop/browser.h index 02a2476cd..25f01d04c 100644 --- a/desktop/browser.h +++ b/desktop/browser.h @@ -90,7 +90,7 @@ void browser_window_go_post(struct browser_window *bw, const char *url, struct form_successful_control *post_multipart, bool history_add); void browser_window_stop(struct browser_window *bw); -void browser_window_reload(struct browser_window *bw); +void browser_window_reload(struct browser_window *bw, bool all); void browser_window_destroy(struct browser_window *bw); int browser_window_action(struct browser_window* bw, struct browser_action* act); -- cgit v1.2.3