r2680 jmb - /trunk/netsurf/render/layout.c

James Bursa james at semichrome.net
Fri Jun 30 15:25:43 BST 2006


> Author: jmb
> Date: Fri Jun 30 00:30:06 2006
> New Revision: 2680
>
> URL: http://svn.semichrome.net?rev=2680&view=rev
> Log:
> Ensure containing block has valid height for positioning absolute children
>
> Modified:
>     trunk/netsurf/render/layout.c
>
> Modified: trunk/netsurf/render/layout.c
> URL:
> http://svn.semichrome.net/trunk/netsurf/render/layout.c?rev=2680&r1=2679&r2=2680&view=diff
> ==============================================================================
> --- trunk/netsurf/render/layout.c (original)
> +++ trunk/netsurf/render/layout.c Fri Jun 30 00:30:06 2006
> @@ -158,6 +158,7 @@
>  	int max_pos_margin = 0;
>  	int max_neg_margin = 0;
>  	int y;
> +	int old_height;
>  	struct box *margin_box;
>
>  	assert(block->type == BOX_BLOCK ||
> @@ -296,9 +297,18 @@
>  			cy = y;
>  		}
>
> +		/* Before positioning absolute children, ensure box has a
> +		 * valid height. */
> +		old_height = box->height;
> +		if (box->height == AUTO)
> +			box->height = 0;
> +
>  		/* Absolutely positioned children. */
>  		if (!layout_absolute_children(box, content))
>  			return false;
> +
> +		/* And restore height for normal layout */
> +		box->height = old_height;
>
>  		/* Advance to next box. */
>  		if (box->type == BOX_BLOCK && !box->object && box->children) {

This is strange. What case did you find where this was a problem? The
height of a box should never be AUTO when layout is complete.





More information about the netsurf-dev mailing list