summaryrefslogtreecommitdiff
path: root/render/layout.c
diff options
context:
space:
mode:
authorJames Bursa <james@netsurf-browser.org>2005-08-07 21:28:48 +0000
committerJames Bursa <james@netsurf-browser.org>2005-08-07 21:28:48 +0000
commit419517f0aa62055e6fe7fdd401fdb3cddd6c0fd6 (patch)
treee2d0061527718d8beac381a1fcac57e0c9cdbf2f /render/layout.c
parent1808739e3361c89f7d9a2995b5a1478c5fdf1b3e (diff)
downloadnetsurf-419517f0aa62055e6fe7fdd401fdb3cddd6c0fd6.tar.gz
netsurf-419517f0aa62055e6fe7fdd401fdb3cddd6c0fd6.tar.bz2
[project @ 2005-08-07 21:28:48 by bursa]
Improvements to frames. Fix bug with BR at end of inline container. svn path=/import/netsurf/; revision=1843
Diffstat (limited to 'render/layout.c')
-rw-r--r--render/layout.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/render/layout.c b/render/layout.c
index 2e5cec984..6e0f68835 100644
--- a/render/layout.c
+++ b/render/layout.c
@@ -997,6 +997,7 @@ bool layout_line(struct box *first, int width, int *y,
struct box *b;
struct box *split_box = 0;
struct box *d;
+ struct box *br_box = 0;
bool move_y = false;
int space_before = 0, space_after = 0;
unsigned int inline_count = 0;
@@ -1243,6 +1244,7 @@ bool layout_line(struct box *first, int width, int *y,
} else if (b->type == BOX_BR) {
b->x = x;
b->width = 0;
+ br_box = b;
b = b->next;
split_box = 0;
move_y = true;
@@ -1436,10 +1438,9 @@ bool layout_line(struct box *first, int width, int *y,
assert(b != first || (move_y && 0 < used_height && (left || right)));
/* handle clearance for br */
- if (b->prev->type == BOX_BR &&
- b->prev->style->clear != CSS_CLEAR_NONE) {
+ if (br_box && br_box->style->clear != CSS_CLEAR_NONE) {
int clear_y = layout_clear(cont->float_children,
- b->prev->style->clear);
+ br_box->style->clear);
if (used_height < clear_y - cy)
used_height = clear_y - cy;
}
@@ -2388,6 +2389,10 @@ void layout_calculate_descendant_bboxes(struct box *box)
layout_calculate_descendant_bboxes(child);
+ if (child->style &&
+ child->style->overflow != CSS_OVERFLOW_VISIBLE)
+ continue;
+
if (child->x + child->descendant_x0 < box->descendant_x0)
box->descendant_x0 = child->x + child->descendant_x0;
if (box->descendant_x1 < child->x + child->descendant_x1)