diff options
author | James Bursa <james@netsurf-browser.org> | 2003-10-09 15:22:48 +0000 |
---|---|---|
committer | James Bursa <james@netsurf-browser.org> | 2003-10-09 15:22:48 +0000 |
commit | 65263651e3c8036a631270976a773f3d4497f474 (patch) | |
tree | 64a40c515273b5f8f16188917abaccd63d560fca /render/box.c | |
parent | c673e138dc76600fd72a09428a7a36dc4ec390c3 (diff) | |
download | netsurf-65263651e3c8036a631270976a773f3d4497f474.tar.gz netsurf-65263651e3c8036a631270976a773f3d4497f474.tar.bz2 |
[project @ 2003-10-09 15:22:48 by bursa]
Implement box_insert_sibling().
svn path=/import/netsurf/; revision=358
Diffstat (limited to 'render/box.c')
-rw-r--r-- | render/box.c | 23 |
1 files changed, 20 insertions, 3 deletions
diff --git a/render/box.c b/render/box.c index 9a9eb2def..77fc99f00 100644 --- a/render/box.c +++ b/render/box.c @@ -44,7 +44,6 @@ struct result { int convert_children; /* children should be converted */ }; -static void box_add_child(struct box * parent, struct box * child); static struct box * convert_xml_to_box(xmlNode * n, struct content *content, struct css_style * parent_style, struct css_selector ** selector, unsigned int depth, @@ -119,7 +118,7 @@ static const struct element_entry element_table[] = { /** - * add a child to a box tree node + * Add a child to a box tree node. */ void box_add_child(struct box * parent, struct box * child) @@ -136,8 +135,9 @@ void box_add_child(struct box * parent, struct box * child) child->parent = parent; } + /** - * create a box tree node + * Create a box tree node. */ struct box * box_create(struct css_style * style, @@ -179,6 +179,23 @@ struct box * box_create(struct css_style * style, /** + * Insert a new box as a sibling to a box in a tree. + */ + +void box_insert_sibling(struct box *box, struct box *new_box) +{ + new_box->parent = box->parent; + new_box->prev = box; + new_box->next = box->next; + box->next = new_box; + if (new_box->next) + new_box->next->prev = new_box; + else if (new_box->parent) + new_box->parent->last = new_box; +} + + +/** * make a box tree with style data from an xml tree */ |