mirror of
https://github.com/netsurf-browser/netsurf
synced 2024-12-22 20:16:54 +03:00
Browser: Don't add history entry until after reformat.
Adding a history entry causes content_redraw() for the thumbnail. But we can't content_redraw() until after content_reformat(). Otherwise we get HTML redraw before HTML layout has happened.
This commit is contained in:
parent
3c3685eb96
commit
a72771f8eb
@ -1405,6 +1405,10 @@ browser_window_callback(hlcache_handle *c,
|
|||||||
bw->current_content = c;
|
bw->current_content = c;
|
||||||
bw->loading_content = NULL;
|
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);
|
||||||
|
|
||||||
/* history */
|
/* history */
|
||||||
if (bw->history_add && bw->history) {
|
if (bw->history_add && bw->history) {
|
||||||
nsurl *url = hlcache_handle_get_url(c);
|
nsurl *url = hlcache_handle_get_url(c);
|
||||||
@ -1437,14 +1441,14 @@ browser_window_callback(hlcache_handle *c,
|
|||||||
* all newly visited URLs. With the history_add call
|
* all newly visited URLs. With the history_add call
|
||||||
* after, we only leak the thumbnails when urldb does
|
* after, we only leak the thumbnails when urldb does
|
||||||
* not add the URL.
|
* not add the URL.
|
||||||
|
*
|
||||||
|
* Also, since browser_window_history_add can create
|
||||||
|
* a thumbnail (content_redraw), we need to do it after
|
||||||
|
* content_reformat.
|
||||||
*/
|
*/
|
||||||
browser_window_history_add(bw, c, bw->frag_id);
|
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);
|
browser_window_remove_caret(bw, false);
|
||||||
|
|
||||||
if (bw->window != NULL) {
|
if (bw->window != NULL) {
|
||||||
|
Loading…
Reference in New Issue
Block a user