summaryrefslogtreecommitdiff
path: root/render/layout.c
diff options
context:
space:
mode:
authorMichael Drake <tlsa@netsurf-browser.org>2008-12-21 15:51:23 +0000
committerMichael Drake <tlsa@netsurf-browser.org>2008-12-21 15:51:23 +0000
commit6a4d4489f55f24ed0e446bac1e661a78513cc0a6 (patch)
tree0ef78fd40ac2b60f77bd0f96789b9e655dc55c2b /render/layout.c
parent5bff3e3287501d494536b074a5c540c5be2e94bd (diff)
downloadnetsurf-6a4d4489f55f24ed0e446bac1e661a78513cc0a6.tar.gz
netsurf-6a4d4489f55f24ed0e446bac1e661a78513cc0a6.tar.bz2
Rewrite inline rendering. Fixes issues with borders,
background colour and background image display when inlines have margins and paddings. Support for background position on inlines. Fix BOX_INLINE descendant calculation to include BOX_INLINE_END. svn path=/trunk/netsurf/; revision=5916
Diffstat (limited to 'render/layout.c')
-rw-r--r--render/layout.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/render/layout.c b/render/layout.c
index 34d4933cb..e3b1c3bdd 100644
--- a/render/layout.c
+++ b/render/layout.c
@@ -2014,6 +2014,7 @@ bool layout_line(struct box *first, int *width, int *y,
}
for (d = first; d != b; d = d->next) {
+ d->inline_new_line = false;
if (d->type == BOX_INLINE || d->type == BOX_BR ||
d->type == BOX_TEXT ||
d->type == BOX_INLINE_END) {
@@ -2042,6 +2043,7 @@ bool layout_line(struct box *first, int *width, int *y,
if (d->type == BOX_TEXT && d->height > used_height)
used_height = d->height;
}
+ first->inline_new_line = true;
assert(b != first || (move_y && 0 < used_height && (left || right)));
@@ -3730,8 +3732,7 @@ void layout_calculate_descendant_bboxes(struct box *box)
if (box->type == BOX_INLINE_END) {
box = box->inline_end;
- for (child = box->next;
- child && child != box->inline_end;
+ for (child = box->next; child;
child = child->next) {
if (child->type == BOX_FLOAT_LEFT ||
child->type == BOX_FLOAT_RIGHT)
@@ -3753,6 +3754,8 @@ void layout_calculate_descendant_bboxes(struct box *box)
child->descendant_y1 - box->y)
box->descendant_y1 = child->y +
child->descendant_y1 - box->y;
+ if (child == box->inline_end)
+ break;
}
return;
}