From a785bc25f7d34a7121739219ccdc063e4ac8ba33 Mon Sep 17 00:00:00 2001 From: James Bursa Date: Sun, 8 Oct 2006 22:46:25 +0000 Subject: Modify implementation of absolute positioning to support "static positions". Absolutely positioned boxes are now in their original place in the tree instead of linked from absolute_children. svn path=/trunk/netsurf/; revision=2984 --- render/box.c | 46 ---------------------------------------------- 1 file changed, 46 deletions(-) (limited to 'render/box.c') diff --git a/render/box.c b/render/box.c index f31b636ec..506d94215 100644 --- a/render/box.c +++ b/render/box.c @@ -84,7 +84,6 @@ struct box * box_create(struct css_style *style, box->inline_end = NULL; box->float_children = NULL; box->next_float = NULL; - box->absolute_children = NULL; box->col = NULL; box->gadget = NULL; box->usemap = NULL; @@ -122,30 +121,6 @@ void box_add_child(struct box *parent, struct box *child) } -/** - * Add an absolutely positioned child to a box tree node. - * - * \param parent box giving birth - * \param child box to link as last child of parent - */ - -void box_add_absolute_child(struct box *parent, struct box *child) -{ - assert(parent); - assert(child); - - if (parent->absolute_children != 0) { /* has children already */ - child->next = parent->absolute_children; - parent->absolute_children->prev = child; - } else { /* this is the first child */ - child->next = 0; - } - - parent->absolute_children = child; - child->parent = parent; -} - - /** * Insert a new box as a sibling to a box in a tree. * @@ -212,11 +187,6 @@ void box_free(struct box *box) box_free(child); } - for (child = box->absolute_children; child; child = next) { - next = child->next; - box_free(child); - } - /* last this box */ box_free_box(box); } @@ -331,15 +301,6 @@ struct box *box_at_point(struct box *box, int x, int y, } } - /* consider absolute children first */ - for (child = box->absolute_children; child; child = child->next) { - if (box_contains_point(child, x - bx, y - by)) { - *box_x = bx + child->x - child->scroll_x; - *box_y = by + child->y - child->scroll_y; - return child; - } - } - /* consider floats second, since they will often overlap other boxes */ for (child = box->float_children; child; child = child->next_float) { if (box_contains_point(child, x - bx, y - by)) { @@ -596,11 +557,4 @@ void box_dump(struct box *box, unsigned int depth) for (c = box->fallback; c; c = c->next) box_dump(c, depth + 1); } - if (box->absolute_children) { - for (i = 0; i != depth; i++) - fprintf(stderr, " "); - fprintf(stderr, "absolute_children:\n"); - for (c = box->absolute_children; c; c = c->next) - box_dump(c, depth + 1); - } } -- cgit v1.2.3