summaryrefslogtreecommitdiff
path: root/desktop
diff options
context:
space:
mode:
authorJohn Mark Bell <jmb@netsurf-browser.org>2004-06-29 19:08:19 +0000
committerJohn Mark Bell <jmb@netsurf-browser.org>2004-06-29 19:08:19 +0000
commitbc533957fd8833976d8558a98b0e81d3f62cbe2e (patch)
tree852cee79b1d04cd19089bfe72e52efd851f7ec9e /desktop
parentafd366ecae80b4edbe0c45b7ef528849b940ff39 (diff)
downloadnetsurf-bc533957fd8833976d8558a98b0e81d3f62cbe2e.tar.gz
netsurf-bc533957fd8833976d8558a98b0e81d3f62cbe2e.tar.bz2
[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
Diffstat (limited to 'desktop')
-rw-r--r--desktop/browser.c19
-rw-r--r--desktop/browser.h2
2 files changed, 19 insertions, 2 deletions
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);