summaryrefslogtreecommitdiff
path: root/render/layout.c
diff options
context:
space:
mode:
authorJames Bursa <james@netsurf-browser.org>2003-04-13 12:50:10 +0000
committerJames Bursa <james@netsurf-browser.org>2003-04-13 12:50:10 +0000
commit63b6455f7365507ce502369b738ecc09e54e25ed (patch)
tree52b677856ffad0793f0f3b7d1ab46d9768d30e8a /render/layout.c
parent120ef825e08eac5ac274449a2df53812073b560d (diff)
downloadnetsurf-63b6455f7365507ce502369b738ecc09e54e25ed.tar.gz
netsurf-63b6455f7365507ce502369b738ecc09e54e25ed.tar.bz2
[project @ 2003-04-13 12:50:10 by bursa]
style element, CSS fixes, id selectors. svn path=/import/netsurf/; revision=124
Diffstat (limited to 'render/layout.c')
-rw-r--r--render/layout.c16
1 files changed, 14 insertions, 2 deletions
diff --git a/render/layout.c b/render/layout.c
index 891d54f1f..7b1e40ba4 100644
--- a/render/layout.c
+++ b/render/layout.c
@@ -1,5 +1,5 @@
/**
- * $Id: layout.c,v 1.38 2003/04/09 21:57:09 bursa Exp $
+ * $Id: layout.c,v 1.39 2003/04/13 12:50:10 bursa Exp $
*/
#include <assert.h>
@@ -408,10 +408,22 @@ struct box * layout_line(struct box * first, unsigned long width, unsigned long
move_y = 1;
/* fprintf(stderr, "layout_line: '%.*s' %li %li\n", b->length, b->text, xp, x); */
} else {
+ /* float */
+ unsigned long w = width;
d = b->children;
d->float_children = 0;
/* css_dump_style(b->style); */
- layout_node(d, width, d, 0, 0);
+ if (d->style->width.width == CSS_WIDTH_AUTO) {
+ /* either a float with no width specified (contravenes standard)
+ * or we don't know the width for some reason, eg. image not loaded */
+ calculate_widths(b);
+ w = width / 2;
+ if (d->max_width < w)
+ w = d->max_width;
+ else if (w < d->min_width)
+ w = d->min_width;
+ }
+ layout_node(d, w, d, 0, 0);
d->x = d->y = 0;
b->width = d->width;
b->height = d->height;