summaryrefslogtreecommitdiff
path: root/render/layout.c
diff options
context:
space:
mode:
authorMichael Drake <tlsa@netsurf-browser.org>2009-01-31 13:26:28 +0000
committerMichael Drake <tlsa@netsurf-browser.org>2009-01-31 13:26:28 +0000
commit414f42faac3f69ab079c11c782cc8fb2da0e888a (patch)
treee02c2af3ffcfc29e0c203a17e69d457c15fe496f /render/layout.c
parentbce01f90bcdc3dd9d574d4bf40897c4d576dc9aa (diff)
downloadnetsurf-414f42faac3f69ab079c11c782cc8fb2da0e888a.tar.gz
netsurf-414f42faac3f69ab079c11c782cc8fb2da0e888a.tar.bz2
Make inline boxes store the height of their line box and include in box tree dump.
svn path=/trunk/netsurf/; revision=6319
Diffstat (limited to 'render/layout.c')
-rw-r--r--render/layout.c20
1 files changed, 18 insertions, 2 deletions
diff --git a/render/layout.c b/render/layout.c
index ba18502a5..bd22abb43 100644
--- a/render/layout.c
+++ b/render/layout.c
@@ -1420,6 +1420,7 @@ bool layout_inline_container(struct box *inline_container, int width,
if ((!c->object && c->text && (c->length || is_pre)) ||
c->type == BOX_BR)
has_text_children = true;
+ c->line_height = 0;
}
/** \todo fix wrapping so that a box with horizontal scrollbar will
@@ -2126,6 +2127,16 @@ bool layout_line(struct box *first, int *width, int *y,
(d->style->position == CSS_POSITION_ABSOLUTE ||
d->style->position == CSS_POSITION_FIXED))
continue;
+ if (d->type == BOX_INLINE && d->inline_end &&
+ d->next != d->inline_end) {
+ if (d->height > d->inline_end->line_height)
+ d->inline_end->line_height = d->height;
+ for (struct box *il = d; il != d->inline_end;
+ il = il->next) {
+ if (d->height > il->line_height)
+ il->line_height = d->height;
+ }
+ }
if ((d->type == BOX_INLINE && (d->object || d->gadget)) ||
d->type == BOX_INLINE_BLOCK) {
h = d->margin[TOP] + d->border[TOP] + d->padding[TOP] +
@@ -2134,9 +2145,14 @@ bool layout_line(struct box *first, int *width, int *y,
if (used_height < h)
used_height = h;
}
- if (d->type == BOX_TEXT && d->height > used_height)
- used_height = d->height;
+ if (d->line_height > used_height)
+ used_height = d->line_height;
}
+
+ /* Set the line_height for the boxes on the current line */
+ for (d = first; d != b; d = d->next)
+ d->line_height = used_height;
+
first->inline_new_line = true;
assert(b != first || (move_y && 0 < used_height && (left || right)));