summaryrefslogtreecommitdiff
path: root/render/box_normalise.c
diff options
context:
space:
mode:
authorJames Bursa <james@netsurf-browser.org>2006-12-08 22:17:45 +0000
committerJames Bursa <james@netsurf-browser.org>2006-12-08 22:17:45 +0000
commit246352fb97a5b97355b4c6c9c74b1f7592c3eab3 (patch)
tree49a988f9f2edcce38a9f4b9b12916a8dce67adbf /render/box_normalise.c
parent7e252084a52dc3d99cb76b9b0bc008c21fa1ff4f (diff)
downloadnetsurf-246352fb97a5b97355b4c6c9c74b1f7592c3eab3.tar.gz
netsurf-246352fb97a5b97355b4c6c9c74b1f7592c3eab3.tar.bz2
Allocate new styles for implied boxes using talloc instead of css_duplicate_style().
svn path=/trunk/netsurf/; revision=3112
Diffstat (limited to 'render/box_normalise.c')
-rw-r--r--render/box_normalise.c18
1 files changed, 10 insertions, 8 deletions
diff --git a/render/box_normalise.c b/render/box_normalise.c
index 69ccc2259..6f1b92dca 100644
--- a/render/box_normalise.c
+++ b/render/box_normalise.c
@@ -22,6 +22,7 @@
#endif
#define NDEBUG
#include "netsurf/utils/log.h"
+#include "netsurf/utils/talloc.h"
struct span_info {
@@ -126,14 +127,14 @@ bool box_normalise_block(struct box *block, struct content *c)
case BOX_TABLE_ROW:
case BOX_TABLE_CELL:
/* insert implied table */
- style = css_duplicate_style(block->style);
+ style = talloc_memdup(c, block->style, sizeof *style);
if (!style)
return false;
css_cascade(style, &css_blank_style);
table = box_create(style, block->href, block->target,
0, 0, c);
if (!table) {
- css_free_style(style);
+ talloc_free(style);
return false;
}
table->type = BOX_TABLE;
@@ -208,7 +209,7 @@ bool box_normalise_table(struct box *table, struct content * c)
case BOX_TABLE_CELL:
/* insert implied table row group */
assert(table->style != NULL);
- style = css_duplicate_style(table->style);
+ style = talloc_memdup(c, table->style, sizeof *style);
if (!style) {
free(col_info.spans);
return false;
@@ -218,7 +219,7 @@ bool box_normalise_table(struct box *table, struct content * c)
table->target, 0, 0, c);
if (!row_group) {
free(col_info.spans);
- css_free_style(style);
+ talloc_free(style);
return false;
}
row_group->type = BOX_TABLE_ROW_GROUP;
@@ -385,14 +386,15 @@ bool box_normalise_table_row_group(struct box *row_group,
case BOX_TABLE_CELL:
/* insert implied table row */
assert(row_group->style != NULL);
- style = css_duplicate_style(row_group->style);
+ style = talloc_memdup(c, row_group->style,
+ sizeof *style);
if (!style)
return false;
css_cascade(style, &css_blank_style);
row = box_create(style, row_group->href,
row_group->target, 0, 0, c);
if (!row) {
- css_free_style(style);
+ talloc_free(style);
return false;
}
row->type = BOX_TABLE_ROW;
@@ -485,14 +487,14 @@ bool box_normalise_table_row(struct box *row,
case BOX_TABLE_ROW:
/* insert implied table cell */
assert(row->style != NULL);
- style = css_duplicate_style(row->style);
+ style = talloc_memdup(c, row->style, sizeof *style);
if (!style)
return false;
css_cascade(style, &css_blank_style);
cell = box_create(style, row->href, row->target, 0, 0,
c);
if (!cell) {
- css_free_style(style);
+ talloc_free(style);
return false;
}
cell->type = BOX_TABLE_CELL;