From 652fe9ac951d6e46085c3fc2f8bba61156021483 Mon Sep 17 00:00:00 2001 From: Richard Wilson Date: Tue, 11 Jan 2005 14:16:40 +0000 Subject: [project @ 2005-01-11 14:16:40 by rjw] Perform vertical alignment for cells with specified heights. svn path=/import/netsurf/; revision=1439 --- render/layout.c | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) (limited to 'render') diff --git a/render/layout.c b/render/layout.c index 93772e10d..36e1302c4 100644 --- a/render/layout.c +++ b/render/layout.c @@ -1451,8 +1451,9 @@ bool layout_table(struct box *table, int available_width, free(xs); return false; } - /* preserve c->padding[BOTTOM] in c->descendant_y1 which is not used at this - * point in time. */ + /* warning: c->descendant_y0 and c->descendant_y1 used as temporary + * storage until after vertical alignment is complete */ + c->descendant_y0 = c->height; c->descendant_y1 = c->padding[BOTTOM]; if (c->style->height.height == CSS_HEIGHT_LENGTH) { @@ -1528,8 +1529,10 @@ bool layout_table(struct box *table, int available_width, for (row_group = table->children; row_group; row_group = row_group->next) { for (row = row_group->children; row; row = row->next) { for (c = row->children; c; c = c->next) { - /* unextended bottom padding is in c->descendant_y1 */ - spare_height = c->padding[BOTTOM] - c->descendant_y1; + /* unextended bottom padding is in c->descendant_y1, and unextended + * cell height is in c->descendant_y0 */ + spare_height = (c->padding[BOTTOM] - c->descendant_y1) + + (c->height - c->descendant_y0); switch (c->style->vertical_align.type) { case CSS_VERTICAL_ALIGN_SUB: case CSS_VERTICAL_ALIGN_SUPER: -- cgit v1.2.3