diff options
author | James Bursa <james@netsurf-browser.org> | 2005-05-22 21:50:14 +0000 |
---|---|---|
committer | James Bursa <james@netsurf-browser.org> | 2005-05-22 21:50:14 +0000 |
commit | 22640f85e0d245df817df96afa18d382e3a1b49a (patch) | |
tree | 57420cd508f6bd05fe7ad4fff3d8438a91ebf770 /render/layout.c | |
parent | 48d1759374e95bbc0c59fa2c87e9e8122f0e1273 (diff) | |
download | netsurf-22640f85e0d245df817df96afa18d382e3a1b49a.tar.gz netsurf-22640f85e0d245df817df96afa18d382e3a1b49a.tar.bz2 |
[project @ 2005-05-22 21:50:14 by bursa]
Add BOX_TEXT type to distinguish boxes which came from an inline element to boxes which came from a text node. Add inline_parent pointer to box structure. Rewrite text-decoration support to take advantage of the new data (line colours are now correct). Note: there is a clipping issue in redraw.
svn path=/import/netsurf/; revision=1732
Diffstat (limited to 'render/layout.c')
-rw-r--r-- | render/layout.c | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/render/layout.c b/render/layout.c index 3e6c2a367..8cf417c4e 100644 --- a/render/layout.c +++ b/render/layout.c @@ -761,7 +761,7 @@ bool layout_line(struct box *first, int width, int *y, assert(b->type == BOX_INLINE || b->type == BOX_INLINE_BLOCK || b->type == BOX_FLOAT_LEFT || b->type == BOX_FLOAT_RIGHT || - b->type == BOX_BR); + b->type == BOX_BR || b->type == BOX_TEXT); x += space_after; @@ -784,7 +784,7 @@ bool layout_line(struct box *first, int width, int *y, if (b->type == BOX_BR) break; - if (b->type != BOX_INLINE) + if (b->type != BOX_INLINE && b->type != BOX_TEXT) continue; if (!b->object && !b->gadget) { @@ -908,7 +908,8 @@ bool layout_line(struct box *first, int width, int *y, /* pass 2: place boxes in line: loop body executed at least once */ for (x = x_previous = 0, b = first; x <= x1 - x0 && b; b = b->next) { - if (b->type == BOX_INLINE || b->type == BOX_INLINE_BLOCK) { + if (b->type == BOX_INLINE || b->type == BOX_INLINE_BLOCK || + b->type == BOX_TEXT) { assert(b->width != UNKNOWN_WIDTH); x_previous = x; @@ -1000,7 +1001,9 @@ bool layout_line(struct box *first, int width, int *y, x = x_previous; - if (split_box->type == BOX_INLINE && !split_box->object && + if ((split_box->type == BOX_INLINE || + split_box->type == BOX_TEXT) && + !split_box->object && !split_box->gadget && split_box->text) { for (i = 0; i != split_box->length && split_box->text[i] != ' '; i++) @@ -1116,7 +1119,7 @@ bool layout_line(struct box *first, int width, int *y, for (d = first; d != b; d = d->next) { if (d->type == BOX_INLINE || d->type == BOX_INLINE_BLOCK || - d->type == BOX_BR) { + d->type == BOX_BR || d->type == BOX_TEXT) { d->x += x0; d->y = *y + d->border[TOP]; h = d->border[TOP] + d->padding[TOP] + d->height + @@ -1800,6 +1803,7 @@ bool calculate_inline_container_widths(struct box *box) for (child = box->children; child != 0; child = child->next) { switch (child->type) { case BOX_INLINE: + case BOX_TEXT: if (child->object) calculate_inline_replaced_widths(child, &min, &max, &line_max); |