summaryrefslogtreecommitdiff
path: root/render/layout.c
diff options
context:
space:
mode:
authorJohn Mark Bell <jmb@netsurf-browser.org>2005-04-02 18:24:47 +0000
committerJohn Mark Bell <jmb@netsurf-browser.org>2005-04-02 18:24:47 +0000
commitf228f3c8da99933e1a6285249bdbe37250f98ce0 (patch)
tree7fc27d9a7794eb6ccb13897f8b359ae05f6f0c50 /render/layout.c
parentbed3897f667bf1f224095b0d05900c20859039ce (diff)
downloadnetsurf-f228f3c8da99933e1a6285249bdbe37250f98ce0.tar.gz
netsurf-f228f3c8da99933e1a6285249bdbe37250f98ce0.tar.bz2
[project @ 2005-04-02 18:24:47 by jmb]
Fix more FP exceptions svn path=/import/netsurf/; revision=1589
Diffstat (limited to 'render/layout.c')
-rw-r--r--render/layout.c17
1 files changed, 13 insertions, 4 deletions
diff --git a/render/layout.c b/render/layout.c
index 47284b42e..fbe54bda7 100644
--- a/render/layout.c
+++ b/render/layout.c
@@ -722,7 +722,6 @@ bool layout_line(struct box *first, int width, int *y,
int x0 = 0;
int x1 = width;
int x, h, x_previous;
- int space_width;
struct box *left;
struct box *right;
struct box *b;
@@ -756,6 +755,8 @@ bool layout_line(struct box *first, int width, int *y,
b->type == BOX_FLOAT_RIGHT ||
b->type == BOX_BR);
+ x += space_after;
+
if (b->type == BOX_INLINE_BLOCK) {
if (b->width == UNKNOWN_WIDTH)
if (!layout_float(b, width, box_pool))
@@ -769,6 +770,7 @@ bool layout_line(struct box *first, int width, int *y,
b->padding[LEFT] + b->width +
b->padding[RIGHT] + b->border[RIGHT] +
b->margin[RIGHT];
+ space_after = 0;
}
if (b->type == BOX_BR)
@@ -793,15 +795,20 @@ bool layout_line(struct box *first, int width, int *y,
if (b->space) {
/** \todo optimize out */
nsfont_width(b->style, " ", 1,
- &space_width);
- x += space_width;
+ &space_after);
}
- } else
+ else
+ space_after = 0;
+ } else {
b->width = 0;
+ space_after = 0;
+ }
continue;
}
+ space_after = 0;
+
/* inline replaced, 10.3.2 and 10.6.2 */
assert(b->style);
@@ -889,6 +896,8 @@ bool layout_line(struct box *first, int width, int *y,
if (x1 < x0)
x1 = x0;
+ space_after = space_before = 0;
+
/* 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) {