summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChris Young <chris@unsatisfactorysoftware.co.uk>2013-02-22 19:03:32 +0000
committerChris Young <chris@unsatisfactorysoftware.co.uk>2013-02-22 19:03:32 +0000
commit84fca8a29cb60f0eaad1c578769d0facb5065ea3 (patch)
tree771efd9955de791c00767af521257f132b10ea3d
parent4d9b67499727f1cce58c2bd65a06178f91fc30b4 (diff)
parent131db5c8da8bf94bb08aa13e895aa753817b1ff3 (diff)
downloadnetsurf-84fca8a29cb60f0eaad1c578769d0facb5065ea3.tar.gz
netsurf-84fca8a29cb60f0eaad1c578769d0facb5065ea3.tar.bz2
Merge branch 'master' of git://git.netsurf-browser.org/netsurf
-rw-r--r--render/layout.c14
1 files changed, 12 insertions, 2 deletions
diff --git a/render/layout.c b/render/layout.c
index d8aa2f7da..2c234f609 100644
--- a/render/layout.c
+++ b/render/layout.c
@@ -3065,9 +3065,15 @@ struct box *layout_minmax_line(struct box *first,
if (!b->object && !(b->flags & IFRAME) && !b->gadget &&
!(b->flags & REPLACE_DIM)) {
/* inline non-replaced, 10.3.1 and 10.6.1 */
+ bool no_wrap;
if (!b->text)
continue;
+ no_wrap = (css_computed_white_space(b->style) ==
+ CSS_WHITE_SPACE_NOWRAP ||
+ css_computed_white_space(b->style) ==
+ CSS_WHITE_SPACE_PRE);
+
if (b->width == UNKNOWN_WIDTH) {
/** \todo handle errors */
@@ -3111,11 +3117,15 @@ struct box *layout_minmax_line(struct box *first,
max += b->space;
}
- /* min = widest word */
- if (b->parent->flags & NEED_MIN) {
+ if (no_wrap) {
+ /* can't wrap, so min is the same as max */
+ min = max;
+
+ } else if (b->parent->flags & NEED_MIN) {
/* If we care what the minimum width is,
* calculate it. (It's only needed if we're
* shrinking-to-fit.) */
+ /* min = widest single word */
i = 0;
do {
for (j = i; j != b->length &&