From 57b68bd9332f4c1636073ab8dd10a3ce50a173cf Mon Sep 17 00:00:00 2001 From: James Bursa Date: Sun, 5 Jun 2005 20:54:37 +0000 Subject: [project @ 2005-06-05 20:54:37 by bursa] More work on borders / padding / margins on inline elements. Add BOX_INLINE_END to hold the right border / padding / margin (left is in the BOX_INLINE). svn path=/import/netsurf/; revision=1742 --- render/box_construct.c | 24 ++++++++++++++++++------ 1 file changed, 18 insertions(+), 6 deletions(-) (limited to 'render/box_construct.c') diff --git a/render/box_construct.c b/render/box_construct.c index c3dc1e7bc..961fc7f17 100644 --- a/render/box_construct.c +++ b/render/box_construct.c @@ -263,6 +263,7 @@ bool box_construct_element(xmlNode *n, struct content *content, char *s; struct box *box = 0; struct box *inline_container_c; + struct box *inline_end; struct css_style *style = 0; struct element_entry *element; colour border_color; @@ -336,13 +337,24 @@ bool box_construct_element(xmlNode *n, struct content *content, if (box->type == BOX_INLINE || box->type == BOX_BR) { /* inline box: add to tree and recurse */ box_add_child(*inline_container, box); - for (c = n->children; convert_children && c; c = c->next) - if (!convert_xml_to_box(c, content, style, parent, - inline_container, href, title)) + if (convert_children) { + for (c = n->children; c; c = c->next) + if (!convert_xml_to_box(c, content, style, + parent, inline_container, + href, title)) + return false; + inline_end = box_create(style, href, title, id, + content); + if (!inline_end) return false; - /* corrected to next box (which doesn't exist yet) in - * box_normalise_inline_container() */ - box->end_inline_children = (*inline_container)->last; + inline_end->type = BOX_INLINE_END; + if (*inline_container) + box_add_child(*inline_container, inline_end); + else + box_add_child(box->parent, inline_end); + box->inline_end = inline_end; + inline_end->inline_end = box; + } } else if (box->type == BOX_INLINE_BLOCK) { /* inline block box: add to tree and recurse */ box_add_child(*inline_container, box); -- cgit v1.2.3