summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Drake <michael.drake@codethink.co.uk>2017-09-23 15:03:31 (GMT)
committer Michael Drake <michael.drake@codethink.co.uk>2017-09-23 15:03:31 (GMT)
commitfb4be0feb2afd8a3d321673c92a5612be570a70a (patch)
treeeea18424611c46f09dddc4fb4af9c6dce7f2dba4
parent628fb0ceeff58573a3e094471dda7f07230df3f5 (diff)
downloadnetsurf-fb4be0feb2afd8a3d321673c92a5612be570a70a.tar.gz
netsurf-fb4be0feb2afd8a3d321673c92a5612be570a70a.tar.bz2
Browser history: Create new history entries early in the READY state.
This prevents us updating the previous history entry with this page's scroll offsets.
-rw-r--r--desktop/browser.c34
1 files changed, 17 insertions, 17 deletions
diff --git a/desktop/browser.c b/desktop/browser.c
index b82d8ef..19cfebb 100644
--- a/desktop/browser.c
+++ b/desktop/browser.c
@@ -1405,23 +1405,6 @@ browser_window_callback(hlcache_handle *c,
bw->current_content = c;
bw->loading_content = NULL;
- /* Format the new content to the correct dimensions */
- browser_window_get_dimensions(bw, &width, &height, true);
- content_reformat(c, false, width, height);
-
- browser_window_remove_caret(bw, false);
-
- if (bw->window != NULL) {
- guit->window->new_content(bw->window);
-
- browser_window_refresh_url_bar(bw);
- }
-
- /* new content; set scroll_to_top */
- browser_window_update(bw, true);
- content_open(c, bw, 0, 0);
- browser_window_set_status(bw, content_get_status_message(c));
-
/* history */
if (bw->history_add && bw->history) {
nsurl *url = hlcache_handle_get_url(c);
@@ -1458,6 +1441,23 @@ browser_window_callback(hlcache_handle *c,
browser_window_history_add(bw, c, bw->frag_id);
}
+ /* Format the new content to the correct dimensions */
+ browser_window_get_dimensions(bw, &width, &height, true);
+ content_reformat(c, false, width, height);
+
+ browser_window_remove_caret(bw, false);
+
+ if (bw->window != NULL) {
+ guit->window->new_content(bw->window);
+
+ browser_window_refresh_url_bar(bw);
+ }
+
+ /* new content; set scroll_to_top */
+ browser_window_update(bw, true);
+ content_open(c, bw, 0, 0);
+ browser_window_set_status(bw, content_get_status_message(c));
+
/* frames */
if ((content_get_type(c) == CONTENT_HTML) &&
(html_get_frameset(c) != NULL)) {