diff options
author | Michael Drake <tlsa@netsurf-browser.org> | 2008-03-20 23:07:55 +0000 |
---|---|---|
committer | Michael Drake <tlsa@netsurf-browser.org> | 2008-03-20 23:07:55 +0000 |
commit | 7bc23066126b76f4d6622f77bd8e928109cebf09 (patch) | |
tree | da80b6b0d05ecb05006a8dbaa418b3f7a8ff855f /render/layout.c | |
parent | d43e712aff86194cfdbe8f0763a0bd173b759a81 (diff) | |
download | netsurf-7bc23066126b76f4d6622f77bd8e928109cebf09.tar.gz netsurf-7bc23066126b76f4d6622f77bd8e928109cebf09.tar.bz2 |
CSS min-height and max-height properties override fixed heights too.
svn path=/trunk/netsurf/; revision=4003
Diffstat (limited to 'render/layout.c')
-rw-r--r-- | render/layout.c | 28 |
1 files changed, 16 insertions, 12 deletions
diff --git a/render/layout.c b/render/layout.c index a4d1cac6d..93df43038 100644 --- a/render/layout.c +++ b/render/layout.c @@ -380,22 +380,22 @@ bool layout_block_context(struct box *block, struct content *content) if (box->height == AUTO) { box->height = y - box->padding[TOP]; - if (layout_apply_minmax_height(box)) { - /* Height altered */ - /* Set current cy */ - cy += box->height - - (y - box->padding[TOP]); - /* Update y for any change in - * height */ - y = box->height + - box->padding[TOP]; - } if (box->type == BOX_BLOCK) layout_block_add_scrollbar(box, BOTTOM); } else cy += box->height - (y - box->padding[TOP]); + + if (layout_apply_minmax_height(box)) { + /* Height altered */ + /* Set current cy */ + cy += box->height - + (y - box->padding[TOP]); + /* Update y for any change in height */ + y = box->height + box->padding[TOP]; + } + cy += box->padding[BOTTOM] + box->border[BOTTOM]; if (max_pos_margin < box->margin[BOTTOM]) @@ -977,7 +977,10 @@ bool layout_inline_container(struct box *inline_container, int width, has_text_children = true; } - /** \todo fix wrapping so that a box with horizontal scrollbar will shrink back to 'width' if no word is wider than 'width' (Or just set curwidth = width and have the multiword lines wrap to the min width) */ + /** \todo fix wrapping so that a box with horizontal scrollbar will + * shrink back to 'width' if no word is wider than 'width' (Or just set + * curwidth = width and have the multiword lines wrap to the min width) + */ for (c = inline_container->children; c; ) { LOG(("c %p", c)); curwidth = inline_container->width; @@ -1492,7 +1495,8 @@ bool layout_line(struct box *first, int *width, int *y, split_box->type == BOX_TEXT) && !split_box->object && !split_box->gadget && split_box->text) { - /* skip leading spaces, otherwise code gets fooled into thinking it's all one long word */ + /* skip leading spaces, otherwise code gets fooled into + * thinking it's all one long word */ for (i = 0; i != split_box->length && split_box->text[i] == ' '; i++) ; |