diff options
author | James Bursa <james@netsurf-browser.org> | 2006-12-26 21:51:08 +0000 |
---|---|---|
committer | James Bursa <james@netsurf-browser.org> | 2006-12-26 21:51:08 +0000 |
commit | 367c2aea885ce17e9fc5df89c6e357df53457b23 (patch) | |
tree | ddf7da99d6ea567b3c11984a1ff95a63111111b7 /render/layout.c | |
parent | 5b3f0755f6ef17c666b91c27c42e732fe294cee7 (diff) | |
download | netsurf-367c2aea885ce17e9fc5df89c6e357df53457b23.tar.gz netsurf-367c2aea885ce17e9fc5df89c6e357df53457b23.tar.bz2 |
Fix height of absolutely positioned inline blocks with an object. Fix layout of list markers with no text.
svn path=/trunk/netsurf/; revision=3122
Diffstat (limited to 'render/layout.c')
-rw-r--r-- | render/layout.c | 28 |
1 files changed, 22 insertions, 6 deletions
diff --git a/render/layout.c b/render/layout.c index 6c52b25c1..b305747f7 100644 --- a/render/layout.c +++ b/render/layout.c @@ -179,8 +179,19 @@ bool layout_block_context(struct box *block, struct content *content) block->float_children = 0; /* special case if the block contains an object */ - if (block->object) - return layout_block_object(block); + if (block->object) { + if (!layout_block_object(block)) + return false; + if (block->height == AUTO) { + if (block->object->width) + block->height = block->object->height * + (float) block->width / + block->object->width; + else + block->height = block->object->height; + } + return true; + } box = margin_box = block->children; /* set current coordinates to top-left of the block */ @@ -2400,7 +2411,7 @@ void layout_lists(struct box *box) marker->height = marker->object->height; marker->y = (line_height(marker->style) - marker->height) / 2; - } else { + } else if (marker->text) { if (marker->width == UNKNOWN_WIDTH) nsfont_width(marker->style, marker->text, @@ -2409,6 +2420,11 @@ void layout_lists(struct box *box) marker->x = -marker->width; marker->y = 0; marker->height = line_height(marker->style); + } else { + marker->x = 0; + marker->y = 0; + marker->width = 0; + marker->height = 0; } marker->x -= 4; // Gap between marker and content } @@ -2952,12 +2968,12 @@ void layout_calculate_descendant_bboxes(struct box *box) { struct box *child; - if (box->width == UNKNOWN_WIDTH /*|| + if (box->width == UNKNOWN_WIDTH || box->height == AUTO /*|| box->width < 0 || box->height < 0*/) { LOG(("%p has bad width or height", box)); - while (box->parent) + /*while (box->parent) box = box->parent; - box_dump(box, 0); + box_dump(box, 0);*/ assert(0); } |