From 9b78daf135d7fa555990454c219649e4d54157d2 Mon Sep 17 00:00:00 2001 From: James Bursa Date: Sat, 2 Jul 2005 18:17:51 +0000 Subject: [project @ 2005-07-02 18:17:51 by bursa] Rewrite calculation of box minimum and maximum widths to improve layout of many pages. Move calculation of column types and border collapsing to box tree normalising stage, since they are layout independent. Add window height parameter to layout and make and at least window height. svn path=/import/netsurf/; revision=1777 --- desktop/browser.c | 30 +++++++++++------------------- desktop/gui.h | 1 + 2 files changed, 12 insertions(+), 19 deletions(-) (limited to 'desktop') diff --git a/desktop/browser.c b/desktop/browser.c index e65fa38c6..d048e7ca5 100644 --- a/desktop/browser.c +++ b/desktop/browser.c @@ -213,7 +213,8 @@ void browser_window_go_post(struct browser_window *bw, const char *url, bw->history_add = history_add; bw->time0 = clock(); c = fetchcache(url2, browser_window_callback, bw, 0, - gui_window_get_width(bw->window), 0, + gui_window_get_width(bw->window), + gui_window_get_height(bw->window), false, post_urlenc, post_multipart, true, download); free(url2); @@ -235,7 +236,8 @@ void browser_window_go_post(struct browser_window *bw, const char *url, fetchcache_go(c, option_send_referer ? referer : 0, browser_window_callback, bw, 0, - gui_window_get_width(bw->window), 0, + gui_window_get_width(bw->window), + gui_window_get_height(bw->window), post_urlenc, post_multipart, true); } @@ -738,7 +740,6 @@ void browser_window_mouse_action_html(struct browser_window *bw, browser_mouse_state mouse, int x, int y) { char *base_url = 0; - char *href = 0; char *title = 0; char *url = 0; char status_buffer[200]; @@ -774,16 +775,12 @@ void browser_window_mouse_action_html(struct browser_window *bw, if (box->object) object = box->object; - if (box->href) { - base_url = content->data.html.base_url; - href = box->href; - } + if (box->href) + url = box->href; - if (box->usemap) { - base_url = content->data.html.base_url; - href = imagemap_get(content, box->usemap, + if (box->usemap) + url = imagemap_get(content, box->usemap, box_x, box_y, x, y); - } if (box->gadget) { gadget_content = content; @@ -802,6 +799,7 @@ void browser_window_mouse_action_html(struct browser_window *bw, if (box->style && box->type != BOX_BR && box->type != BOX_INLINE && + box->type != BOX_TEXT && (box->style->overflow == CSS_OVERFLOW_SCROLL || box->style->overflow == CSS_OVERFLOW_AUTO) && ((box_vscrollbar_present(box) && @@ -918,14 +916,10 @@ void browser_window_mouse_action_html(struct browser_window *bw, /* \todo should have a drag-saving object msg */ status = c->status_message; - } else if (href) { - res = url_join(href, base_url, &url); - if (res != URL_FUNC_OK) - return; - + } else if (url) { if (title) { snprintf(status_buffer, sizeof status_buffer, "%s: %s", - title, url); + url, title); status = status_buffer; } else status = url; @@ -1000,8 +994,6 @@ void browser_window_mouse_action_html(struct browser_window *bw, browser_window_set_status(bw, status); browser_window_set_pointer(pointer); - - free(url); } diff --git a/desktop/gui.h b/desktop/gui.h index c56b2d504..59d7e6933 100644 --- a/desktop/gui.h +++ b/desktop/gui.h @@ -60,6 +60,7 @@ void gui_window_update_box(struct gui_window *g, bool gui_window_get_scroll(struct gui_window *g, int *sx, int *sy); void gui_window_set_scroll(struct gui_window *g, int sx, int sy); int gui_window_get_width(struct gui_window *g); +int gui_window_get_height(struct gui_window *g); void gui_window_set_extent(struct gui_window *g, int width, int height); void gui_window_set_status(struct gui_window *g, const char *text); void gui_window_set_pointer(gui_pointer_shape shape); -- cgit v1.2.3