From 02898d7b26999891ff3bbb5973bc442d75d9f964 Mon Sep 17 00:00:00 2001 From: James Bursa Date: Fri, 18 Jun 2004 22:54:07 +0000 Subject: [project @ 2004-06-18 22:54:07 by bursa] Fix inline boxes with 0 width not having their width set when available width is 0 (eg. in tables) (fixes www.hic.gov.au crash reported by Peter Prewett). Table layout fix related to cells spanning columns with fixed-width cells. svn path=/import/netsurf/; revision=979 --- render/layout.c | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) (limited to 'render/layout.c') diff --git a/render/layout.c b/render/layout.c index d0224f71f..f80be7dc2 100644 --- a/render/layout.c +++ b/render/layout.c @@ -702,7 +702,7 @@ bool layout_line(struct box *first, int width, int *y, used_height = height = line_height(first->parent->parent->style); /* pass 1: find height of line assuming sides at top of line */ - for (x = 0, b = first; x < x1 - x0 && b != 0; b = b->next) { + for (x = 0, b = first; x <= x1 - x0 && b != 0; b = b->next) { assert(b->type == BOX_INLINE || b->type == BOX_INLINE_BLOCK || b->type == BOX_FLOAT_LEFT || b->type == BOX_FLOAT_RIGHT || @@ -1783,12 +1783,17 @@ bool calculate_table_widths(struct box *table) /* find min, max width so far of * spanned columns */ for (j = 0; j != cell->columns; j++) { - min += col[i + j].min; max += col[i + j].max; - if (col[i + j].type == COLUMN_WIDTH_FIXED) + if (col[i + j].type == COLUMN_WIDTH_FIXED) { + if (col[i + j].min < col[i + j].width) + min += col[i + j].width; + else + min += col[i + j].min; fixed_width += col[i + j].width; - else + } else { + min += col[i + j].min; flexible_columns++; + } } if (cell->style->width.width == CSS_WIDTH_LENGTH) { -- cgit v1.2.3