diff options
author | Richard Wilson <rjw@netsurf-browser.org> | 2005-01-11 14:16:40 +0000 |
---|---|---|
committer | Richard Wilson <rjw@netsurf-browser.org> | 2005-01-11 14:16:40 +0000 |
commit | 652fe9ac951d6e46085c3fc2f8bba61156021483 (patch) | |
tree | dcd8e4052ca17d02692bcdec579446fa4f782236 /render | |
parent | 18407adb7a23e3a1cd2c760a13058539366a3c8e (diff) | |
download | netsurf-652fe9ac951d6e46085c3fc2f8bba61156021483.tar.gz netsurf-652fe9ac951d6e46085c3fc2f8bba61156021483.tar.bz2 |
[project @ 2005-01-11 14:16:40 by rjw]
Perform vertical alignment for cells with specified heights.
svn path=/import/netsurf/; revision=1439
Diffstat (limited to 'render')
-rw-r--r-- | render/layout.c | 11 |
1 files changed, 7 insertions, 4 deletions
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: |