diff options
author | James Bursa <james@netsurf-browser.org> | 2004-06-18 22:54:07 +0000 |
---|---|---|
committer | James Bursa <james@netsurf-browser.org> | 2004-06-18 22:54:07 +0000 |
commit | 02898d7b26999891ff3bbb5973bc442d75d9f964 (patch) | |
tree | a8dfd3536456835966e153d72645c28766d00b25 /render | |
parent | 408e042c196c0e1ef77c6539f6e23f64d7044bba (diff) | |
download | netsurf-02898d7b26999891ff3bbb5973bc442d75d9f964.tar.gz netsurf-02898d7b26999891ff3bbb5973bc442d75d9f964.tar.bz2 |
[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
Diffstat (limited to 'render')
-rw-r--r-- | render/layout.c | 13 |
1 files changed, 9 insertions, 4 deletions
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) { |