diff options
author | Michael Drake <tlsa@netsurf-browser.org> | 2009-02-02 12:56:15 +0000 |
---|---|---|
committer | Michael Drake <tlsa@netsurf-browser.org> | 2009-02-02 12:56:15 +0000 |
commit | b2182b8c503aa56aa7093c9f8475aec27cd6b173 (patch) | |
tree | 84d7c44b6f1dbd8712926f0fba9b441f96544852 /render/layout.c | |
parent | 57124b7f9258057c0b904afdb9d1cbe97aa0b32c (diff) | |
download | netsurf-b2182b8c503aa56aa7093c9f8475aec27cd6b173.tar.gz netsurf-b2182b8c503aa56aa7093c9f8475aec27cd6b173.tar.bz2 |
Fix clear:both; when there's nothing to clear.
svn path=/trunk/netsurf/; revision=6352
Diffstat (limited to 'render/layout.c')
-rw-r--r-- | render/layout.c | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/render/layout.c b/render/layout.c index a9b3bec7b..c24b698a1 100644 --- a/render/layout.c +++ b/render/layout.c @@ -1891,7 +1891,9 @@ bool layout_line(struct box *first, int *width, int *y, (d->style->clear == CSS_CLEAR_LEFT && left == 0) || (d->style->clear == CSS_CLEAR_RIGHT && - right == 0)) && + right == 0) || + (d->style->clear == CSS_CLEAR_BOTH && + left == 0 && right == 0)) && (!place_below || (left == 0 && right == 0 && x == 0)) && cy >= cont->clear_level) { @@ -1928,13 +1930,11 @@ bool layout_line(struct box *first, int *width, int *y, CSS_CLEAR_NONE) { /* to be cleared below existing * floats */ - if (b->type == BOX_FLOAT_LEFT) { + if (b->type == BOX_FLOAT_LEFT) b->x = cx; - left = b; - } else { + else b->x = cx + *width - b->width; - right = b; - } + fy = layout_clear(cont->float_children, d->style->clear); if (fy > cont->clear_level) @@ -1942,6 +1942,10 @@ bool layout_line(struct box *first, int *width, int *y, if (b->y < fy) b->y = fy; } + if (b->type == BOX_FLOAT_LEFT) + left = b; + else + right = b; } if (cont->float_children == b) { LOG(("float %p already placed", b)); |