Author: bursa
Date: Tue Dec 26 21:51:08 2006
New Revision: 3122
URL:
http://svn.semichrome.net?rev=3122&view=rev
Log:
Fix height of absolutely positioned inline blocks with an object. Fix layout of list
markers with no text.
Modified:
trunk/netsurf/render/layout.c
Modified: trunk/netsurf/render/layout.c
URL:
http://svn.semichrome.net/trunk/netsurf/render/layout.c?rev=3122&r1=3...
==============================================================================
--- trunk/netsurf/render/layout.c (original)
+++ trunk/netsurf/render/layout.c Tue Dec 26 21:51:08 2006
@@ -179,8 +179,19 @@
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 @@
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 @@
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 @@
{
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);
}