diff options
author | James Bursa <james@netsurf-browser.org> | 2005-06-05 20:54:37 +0000 |
---|---|---|
committer | James Bursa <james@netsurf-browser.org> | 2005-06-05 20:54:37 +0000 |
commit | 57b68bd9332f4c1636073ab8dd10a3ce50a173cf (patch) | |
tree | 8323cb6b6ed9a63b75751c6fa892c6f927c2c833 /render/box_construct.c | |
parent | 99a483dd7b744ede170eeffde5ec30fd8ed1a0e5 (diff) | |
download | netsurf-57b68bd9332f4c1636073ab8dd10a3ce50a173cf.tar.gz netsurf-57b68bd9332f4c1636073ab8dd10a3ce50a173cf.tar.bz2 |
[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
Diffstat (limited to 'render/box_construct.c')
-rw-r--r-- | render/box_construct.c | 24 |
1 files changed, 18 insertions, 6 deletions
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); |