r5402 tlsa - /trunk/netsurf/render/layout.c

netsurf at semichrome.net netsurf at semichrome.net
Tue Sep 23 00:45:51 BST 2008


Author: tlsa
Date: Mon Sep 22 18:45:51 2008
New Revision: 5402

URL: http://source.netsurf-browser.org?rev=5402&view=rev
Log:
Ignore clear property on floats when there are no floats to clear.

Modified:
    trunk/netsurf/render/layout.c

Modified: trunk/netsurf/render/layout.c
URL: http://source.netsurf-browser.org/trunk/netsurf/render/layout.c?rev=5402&r1=5401&r2=5402&view=diff
==============================================================================
--- trunk/netsurf/render/layout.c (original)
+++ trunk/netsurf/render/layout.c Mon Sep 22 18:45:51 2008
@@ -1609,13 +1609,19 @@
 					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 @@
 				}
 				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;




More information about the netsurf-commits mailing list