summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Silverstone <dsilvers@netsurf-browser.org>2007-12-23 14:15:11 +0000
committerDaniel Silverstone <dsilvers@netsurf-browser.org>2007-12-23 14:15:11 +0000
commit23781fb8628b718bbc62d914338622fed8a7d61f (patch)
tree3fc278824aa0eae6c01b999e75e1acf8bb83d5e9
parent6ee6a8c8dc207ec357ded97c996f8a3e48df43f7 (diff)
downloadnetsurf-23781fb8628b718bbc62d914338622fed8a7d61f.tar.gz
netsurf-23781fb8628b718bbc62d914338622fed8a7d61f.tar.bz2
An INLINE_CONTAINER which contains a TEXT which is zero chars long but *is* in a PRE white-space rule *DOES* contain a text child.
svn path=/trunk/netsurf/; revision=3672
-rw-r--r--render/layout.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/render/layout.c b/render/layout.c
index bda9bb58e..9f05486f3 100644
--- a/render/layout.c
+++ b/render/layout.c
@@ -892,9 +892,13 @@ bool layout_inline_container(struct box *inline_container, int width,
inline_container, width, cont, cx, cy));
has_text_children = false;
- for (c = inline_container->children; c; c = c->next)
- if ((!c->object && c->text && c->length) || c->type == BOX_BR)
- has_text_children = true;
+ for (c = inline_container->children; c; c = c->next) {
+ bool is_pre = (c->style->white_space == CSS_WHITE_SPACE_PRE ||
+ c->style->white_space == CSS_WHITE_SPACE_PRE_LINE ||
+ c->style->white_space == CSS_WHITE_SPACE_PRE_WRAP);
+ if ((!c->object && c->text && (c->length || is_pre)) || c->type == BOX_BR)
+ has_text_children = true;
+ }
/** \todo fix wrapping so that a box with horizontal scrollbar will shrink back to 'width' if no word is wider than 'width' (Or just set curwidth = width and have the multiword lines wrap to the min width) */
for (c = inline_container->children; c; ) {