From fb4be0feb2afd8a3d321673c92a5612be570a70a Mon Sep 17 00:00:00 2001 From: Michael Drake Date: Sat, 23 Sep 2017 16:03:31 +0100 Subject: 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. --- desktop/browser.c | 34 +++++++++++++++++----------------- 1 file changed, 17 insertions(+), 17 deletions(-) diff --git a/desktop/browser.c b/desktop/browser.c index b82d8eff3..19cfebb99 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)) { -- cgit v1.2.3