From 4fad8726a4ae82849f38ffc3ef087181d7f37e14 Mon Sep 17 00:00:00 2001 From: Michael Drake Date: Mon, 22 Sep 2008 23:45:51 +0000 Subject: Ignore clear property on floats when there are no floats to clear. svn path=/trunk/netsurf/; revision=5402 --- render/layout.c | 16 +++++++++++----- 1 file 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; -- cgit v1.2.3