From 210a18e39d5858c86b3a7bfc1562b1ad569e5900 Mon Sep 17 00:00:00 2001 From: James Bursa Date: Sat, 5 Jul 2003 19:51:10 +0000 Subject: [project @ 2003-07-05 19:51:10 by bursa] Bug fixes, start rowspan. svn path=/import/netsurf/; revision=206 --- render/box.c | 14 ++++++++++---- render/box.h | 1 + 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/render/box.c b/render/box.c index 0edd2ee20..253cb112b 100644 --- a/render/box.c +++ b/render/box.c @@ -133,6 +133,7 @@ struct box * box_create(struct css_style * style, box->href = href; box->title = title; box->columns = 1; + box->rows = 1; #ifndef riscos /* under RISC OS, xcalloc makes these unnecessary */ box->text = 0; @@ -292,6 +293,7 @@ struct box * convert_xml_to_box(xmlNode * n, struct content *content, /* general element */ box = box_create(style, status.href, title); } + box->type = box_map[style->display]; } else if (n->type == XML_TEXT_NODE) { text = squash_tolat1(n->content); @@ -328,7 +330,7 @@ struct box * convert_xml_to_box(xmlNode * n, struct content *content, assert(box != 0); if (text != 0 || - style->display == CSS_DISPLAY_INLINE || + box->type == BOX_INLINE || style->float_ == CSS_FLOAT_LEFT || style->float_ == CSS_FLOAT_RIGHT) { /* this is an inline box */ @@ -371,8 +373,8 @@ struct box * convert_xml_to_box(xmlNode * n, struct content *content, else parent->type = BOX_FLOAT_RIGHT; box_add_child(inline_container, parent); - if (style->display == CSS_DISPLAY_INLINE) - style->display = CSS_DISPLAY_BLOCK; + if (box->type == BOX_INLINE) + box->type = BOX_BLOCK; } } @@ -381,7 +383,6 @@ struct box * convert_xml_to_box(xmlNode * n, struct content *content, style->display < CSS_DISPLAY_NONE); /* non-inline box: add to tree and recurse */ - box->type = box_map[style->display]; box_add_child(parent, box); if (convert_children) { inline_container_c = 0; @@ -399,6 +400,11 @@ struct box * convert_xml_to_box(xmlNode * n, struct content *content, box->columns = 1; xmlFree(s); } + if ((s = (char *) xmlGetProp(n, (const xmlChar *) "rowspan"))) { + if ((box->rows = strtol(s, 0, 10)) == 0) + box->rows = 1; + xmlFree(s); + } LOG(("depth %i, node %p, node type %i END", depth, n, n->type)); return inline_container; diff --git a/render/box.h b/render/box.h index b63c4b3ff..6ee732567 100644 --- a/render/box.h +++ b/render/box.h @@ -92,6 +92,7 @@ struct box { char * title; unsigned int length; unsigned int columns; + unsigned int rows; struct box * next; struct box * prev; struct box * children; -- cgit v1.2.3