diff options
author | Michael Drake <tlsa@netsurf-browser.org> | 2009-01-22 15:39:06 +0000 |
---|---|---|
committer | Michael Drake <tlsa@netsurf-browser.org> | 2009-01-22 15:39:06 +0000 |
commit | 3594651a6bdd43626e3b6490adc19327697ff411 (patch) | |
tree | 9ff4417ea73cd95693b87366c35eedcad0176b42 /render | |
parent | 61489da9405ea5f3a2ea7fc8fe828f5296c1e0ea (diff) | |
download | netsurf-3594651a6bdd43626e3b6490adc19327697ff411.tar.gz netsurf-3594651a6bdd43626e3b6490adc19327697ff411.tar.bz2 |
Handle clear before working out available width for tables and blocks that cause a new block formatting context.
svn path=/trunk/netsurf/; revision=6174
Diffstat (limited to 'render')
-rw-r--r-- | render/layout.c | 22 |
1 files changed, 12 insertions, 10 deletions
diff --git a/render/layout.c b/render/layout.c index 54e1b17d2..afb841c99 100644 --- a/render/layout.c +++ b/render/layout.c @@ -319,6 +319,12 @@ bool layout_block_context(struct box *block, struct content *content) goto advance_to_next_box; } + /* Clearance. */ + y = 0; + if (box->style && box->style->clear != CSS_CLEAR_NONE) + y = layout_clear(block->float_children, + box->style->clear); + inset = 0; available_width = box->parent->width; if (box->type == BOX_BLOCK || box->object) { @@ -328,11 +334,12 @@ bool layout_block_context(struct box *block, struct content *content) /* box establishes new block formatting context * so available width may be diminished due to * floats. */ - int x0, x1; + int x0, x1, top; struct box *left, *right; + top = cy > y ? cy : y; x0 = cx; x1 = cx + box->parent->width; - find_sides(block->float_children, cy, cy, + find_sides(block->float_children, top, top, &x0, &x1, &left, &right); inset = x0 - cx; if (box->style->width.width == CSS_WIDTH_AUTO) { @@ -345,11 +352,12 @@ bool layout_block_context(struct box *block, struct content *content) layout_block_add_scrollbar(box, BOTTOM); } else if (box->type == BOX_TABLE) { if (box->style->width.width == CSS_WIDTH_AUTO) { - int x0, x1; + int x0, x1, top; struct box *left, *right; + top = cy > y ? cy : y; x0 = cx; x1 = cx + box->parent->width; - find_sides(block->float_children, cy, cy, + find_sides(block->float_children, top, top, &x0, &x1, &left, &right); available_width = x1 - x0 > 0 ? x1 - x0 : 0; } @@ -372,12 +380,6 @@ bool layout_block_context(struct box *block, struct content *content) else if (max_neg_margin < -box->margin[TOP]) max_neg_margin = -box->margin[TOP]; - /* Clearance. */ - y = 0; - if (box->style && box->style->clear != CSS_CLEAR_NONE) - y = layout_clear(block->float_children, - box->style->clear); - if (box->type != BOX_BLOCK || y || box->border[TOP] || box->padding[TOP]) { margin_box->y += max_pos_margin - max_neg_margin; |