diff options
author | James Bursa <james@netsurf-browser.org> | 2005-11-06 11:00:33 +0000 |
---|---|---|
committer | James Bursa <james@netsurf-browser.org> | 2005-11-06 11:00:33 +0000 |
commit | 04566797cd304ec084867f69bf792fa09e3ea46f (patch) | |
tree | 528203b32c195f57df4bdcf11efa5d15e928cb7a /render/layout.c | |
parent | 0605ba7c12f7b33bf6add55a4081ed0ecd74e61b (diff) | |
download | netsurf-04566797cd304ec084867f69bf792fa09e3ea46f.tar.gz netsurf-04566797cd304ec084867f69bf792fa09e3ea46f.tar.bz2 |
[project @ 2005-11-06 11:00:33 by bursa]
Fix crash when a frame contains floats.
svn path=/import/netsurf/; revision=1877
Diffstat (limited to 'render/layout.c')
-rw-r--r-- | render/layout.c | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/render/layout.c b/render/layout.c index fd2eed207..a607261fd 100644 --- a/render/layout.c +++ b/render/layout.c @@ -93,8 +93,6 @@ bool layout_document(struct content *content, int width, int height) assert(content->type == CONTENT_HTML); - doc->float_children = 0; - layout_minmax_block(doc); layout_block_find_dimensions(width, doc); @@ -161,6 +159,8 @@ bool layout_block_context(struct box *block, struct content *content) gui_multitask(); + block->float_children = 0; + if (block->object) { if (block->object->type == CONTENT_HTML) { box = block->object->data.html.layout; @@ -1285,6 +1285,7 @@ bool layout_line(struct box *first, int width, int *y, } else { /* float */ + LOG(("float %p", b)); d = b->children; d->float_children = 0; /* css_dump_style(b->style); */ @@ -1320,7 +1321,11 @@ bool layout_line(struct box *first, int width, int *y, place_float_below(b, width, cx, cy + height + 1, cont); /* fprintf(stderr, "layout_line: float doesn't fit %li %li\n", b->x, b->y); */ } - assert(cont->float_children != b); + if (cont->float_children == b) { + LOG(("float %p already placed", b)); + box_dump(cont, 0); + assert(0); + } b->next_float = cont->float_children; cont->float_children = b; split_box = 0; @@ -1370,7 +1375,6 @@ bool layout_line(struct box *first, int width, int *y, b = split_box->next; } else { /* cut off first word for this line */ - /* \todo allocate from content */ c2 = talloc_memdup(content, split_box, sizeof *c2); if (!c2) |