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 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) (limited to 'desktop/browser.c') 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); } -- cgit v1.2.3