summaryrefslogtreecommitdiff
path: root/render/box_normalise.c
diff options
context:
space:
mode:
authorJames Bursa <james@netsurf-browser.org>2006-06-26 04:52:34 +0000
committerJames Bursa <james@netsurf-browser.org>2006-06-26 04:52:34 +0000
commit8ee81a7d8e00c70739ece2bafee04c9dce5429c8 (patch)
treebc32e929aa6b337dce4664e911745ebdc51095f2 /render/box_normalise.c
parent8db70d8e2df01bbd1245e790d3594bb72409956d (diff)
downloadnetsurf-8ee81a7d8e00c70739ece2bafee04c9dce5429c8.tar.gz
netsurf-8ee81a7d8e00c70739ece2bafee04c9dce5429c8.tar.bz2
Implement absolute positioning.
svn path=/trunk/netsurf/; revision=2648
Diffstat (limited to 'render/box_normalise.c')
-rw-r--r--render/box_normalise.c38
1 files changed, 38 insertions, 0 deletions
diff --git a/render/box_normalise.c b/render/box_normalise.c
index e241f447f..e9d482d8c 100644
--- a/render/box_normalise.c
+++ b/render/box_normalise.c
@@ -45,6 +45,7 @@ struct columns {
};
+static bool box_normalise_absolute_children(struct box *box, struct content *c);
static bool box_normalise_table(struct box *table, struct content *c);
static void box_normalise_table_spans(struct box *table);
static bool box_normalise_table_row_group(struct box *row_group,
@@ -163,6 +164,34 @@ bool box_normalise_block(struct box *block, struct content *c)
}
}
+ if (!box_normalise_absolute_children(block, c))
+ return false;
+
+ return true;
+}
+
+
+bool box_normalise_absolute_children(struct box *box, struct content *c)
+{
+ struct box *child;
+ struct box *next_child;
+
+ for (child = box->absolute_children; child != 0; child = next_child) {
+ next_child = child->next; /* child may be destroyed */
+ switch (child->type) {
+ case BOX_BLOCK:
+ if (!box_normalise_block(child, c))
+ return false;
+ break;
+ case BOX_TABLE:
+ if (!box_normalise_table(child, c))
+ return false;
+ break;
+ default:
+ assert(0);
+ }
+ }
+
return true;
}
@@ -271,6 +300,9 @@ bool box_normalise_table(struct box *table, struct content * c)
table->rows = col_info.num_rows;
free(col_info.spans);
+ if (!box_normalise_absolute_children(table, c))
+ return false;
+
if (table->children == 0) {
LOG(("table->children == 0, removing"));
if (table->prev == 0)
@@ -435,6 +467,9 @@ bool box_normalise_table_row_group(struct box *row_group,
}
}
+ if (!box_normalise_absolute_children(row_group, c))
+ return false;
+
if (row_group->children == 0) {
LOG(("row_group->children == 0, removing"));
if (row_group->prev == 0)
@@ -548,6 +583,9 @@ bool box_normalise_table_row(struct box *row,
col_info->current_column = 0;
col_info->extra = false;
+ if (!box_normalise_absolute_children(row, c))
+ return false;
+
if (row->children == 0) {
LOG(("row->children == 0, removing"));
if (row->prev == 0)