summaryrefslogtreecommitdiff
path: root/desktop/browser.c
diff options
context:
space:
mode:
authorJohn Mark Bell <jmb@netsurf-browser.org>2010-03-29 22:33:21 +0000
committerJohn Mark Bell <jmb@netsurf-browser.org>2010-03-29 22:33:21 +0000
commit9aca901eb1db3b6f373882fe8b707e44959e2ec1 (patch)
treee21e30e702cab909eacdebc067a78dbd17ff8f8f /desktop/browser.c
parent2a53c4c811a22b7382f0fd071a2f3ce477594340 (diff)
downloadnetsurf-9aca901eb1db3b6f373882fe8b707e44959e2ec1.tar.gz
netsurf-9aca901eb1db3b6f373882fe8b707e44959e2ec1.tar.bz2
The convert stage of a content's state progression no longer reflows the content to the provided dimensions.
It is now defined as converting the content into a state in which it is ready for use. The user of the content is now responsible for performing an initial reformat (sic) of the content before it can be redrawn. Purge width/height parameters from hlcache_handle_retrieve/content_convert/*_convert APIs. Fix up content handlers affected by the above change in semantics. Ensure that browser_window_callback performs an initial reformat of its content. svn path=/trunk/netsurf/; revision=10207
Diffstat (limited to 'desktop/browser.c')
-rw-r--r--desktop/browser.c15
1 files changed, 10 insertions, 5 deletions
diff --git a/desktop/browser.c b/desktop/browser.c
index 0022f3ec6..57a4f59b2 100644
--- a/desktop/browser.c
+++ b/desktop/browser.c
@@ -291,7 +291,6 @@ void browser_window_go_post(struct browser_window *bw, const char *url,
url_func_result res;
int depth = 0;
struct browser_window *cur;
- int width, height;
uint32_t fetch_flags = 0;
bool fetch_is_post = (post_urlenc != NULL || post_multipart != NULL);
llcache_post_data post;
@@ -402,14 +401,13 @@ void browser_window_go_post(struct browser_window *bw, const char *url,
browser_window_remove_caret(bw);
browser_window_destroy_children(bw);
- gui_window_get_dimensions(bw->window, &width, &height, true);
- LOG(("Loading '%s' width %i, height %i", url2, width, height));
+ LOG(("Loading '%s'", url2));
browser_window_set_status(bw, messages_get("Loading"));
bw->history_add = add_to_history;
error = hlcache_handle_retrieve(url2, 0, referer,
- fetch_is_post ? &post : NULL, width, height,
+ fetch_is_post ? &post : NULL,
browser_window_callback, bw,
parent != NULL ? &child : NULL, &c);
if (error == NSERROR_NO_FETCH_HANDLER) {
@@ -462,6 +460,9 @@ nserror browser_window_callback(hlcache_handle *c,
break;
case CONTENT_MSG_READY:
+ {
+ int width, height;
+
assert(bw->loading_content == c);
if (bw->current_content != NULL) {
@@ -475,6 +476,10 @@ nserror browser_window_callback(hlcache_handle *c,
hlcache_handle_release(bw->current_content);
}
+ /* Format the new content to the correct dimensions */
+ gui_window_get_dimensions(bw->window, &width, &height, true);
+ content_reformat(c, width, height);
+
bw->current_content = c;
bw->loading_content = NULL;
@@ -523,7 +528,7 @@ nserror browser_window_callback(hlcache_handle *c,
if (content_get_type(c) == CONTENT_HTML &&
html_get_iframe(c) != NULL)
browser_window_create_iframes(bw, html_get_iframe(c));
-
+ }
break;
case CONTENT_MSG_DONE: