diff options
author | Michael Drake <tlsa@netsurf-browser.org> | 2008-09-22 23:45:51 +0000 |
---|---|---|
committer | Michael Drake <tlsa@netsurf-browser.org> | 2008-09-22 23:45:51 +0000 |
commit | 4fad8726a4ae82849f38ffc3ef087181d7f37e14 (patch) | |
tree | 1dbdd78eb2fb8afacf54099079314965ad05ab78 /render | |
parent | 8c4cbd2b1b10c4d4b76ecc6911faa0da2524d540 (diff) | |
download | netsurf-4fad8726a4ae82849f38ffc3ef087181d7f37e14.tar.gz netsurf-4fad8726a4ae82849f38ffc3ef087181d7f37e14.tar.bz2 |
Ignore clear property on floats when there are no floats to clear.
svn path=/trunk/netsurf/; revision=5402
Diffstat (limited to 'render')
-rw-r--r-- | render/layout.c | 16 |
1 files changed, 11 insertions, 5 deletions
diff --git a/render/layout.c b/render/layout.c index 349764550..82a806479 100644 --- a/render/layout.c +++ b/render/layout.c @@ -1609,13 +1609,19 @@ bool layout_line(struct box *first, int *width, int *y, d->padding[BOTTOM] + d->border[BOTTOM] + d->margin[BOTTOM]; - if (d->style && d->style->clear == CSS_CLEAR_NONE && + if (d->style && (d->style->clear == CSS_CLEAR_NONE || + (d->style->clear != CSS_CLEAR_NONE && + left == 0 && right == 0)) && (b->width <= (x1 - x0) - x || (left == 0 && right == 0 && x == 0)) && cy >= cont->clear_level) { - /* not cleared - * fits next to this line, or this line is - * empty with no floats */ + /* + not cleared or, + * cleared and there are no floats to clear + * + fits next to this line or, + * this line is empty with no floats and + * + current y, cy, is below the clear level + * + * Float affects current line */ if (b->type == BOX_FLOAT_LEFT) { b->x = cx + x0; x0 += b->width; @@ -1627,7 +1633,7 @@ bool layout_line(struct box *first, int *width, int *y, } b->y = cy; } else { - /* cleared or doesn't fit */ + /* cleared or doesn't fit on line */ /* place below into next available space */ fy = (cy > cont->clear_level) ? cy : cont->clear_level; |