mirror of
https://github.com/netsurf-browser/netsurf
synced 2024-12-23 20:46:50 +03:00
[project @ 2003-07-05 19:51:10 by bursa]
Bug fixes, start rowspan. svn path=/import/netsurf/; revision=206
This commit is contained in:
parent
219ef195f5
commit
210a18e39d
14
render/box.c
14
render/box.c
@ -133,6 +133,7 @@ struct box * box_create(struct css_style * style,
|
|||||||
box->href = href;
|
box->href = href;
|
||||||
box->title = title;
|
box->title = title;
|
||||||
box->columns = 1;
|
box->columns = 1;
|
||||||
|
box->rows = 1;
|
||||||
#ifndef riscos
|
#ifndef riscos
|
||||||
/* under RISC OS, xcalloc makes these unnecessary */
|
/* under RISC OS, xcalloc makes these unnecessary */
|
||||||
box->text = 0;
|
box->text = 0;
|
||||||
@ -292,6 +293,7 @@ struct box * convert_xml_to_box(xmlNode * n, struct content *content,
|
|||||||
/* general element */
|
/* general element */
|
||||||
box = box_create(style, status.href, title);
|
box = box_create(style, status.href, title);
|
||||||
}
|
}
|
||||||
|
box->type = box_map[style->display];
|
||||||
|
|
||||||
} else if (n->type == XML_TEXT_NODE) {
|
} else if (n->type == XML_TEXT_NODE) {
|
||||||
text = squash_tolat1(n->content);
|
text = squash_tolat1(n->content);
|
||||||
@ -328,7 +330,7 @@ struct box * convert_xml_to_box(xmlNode * n, struct content *content,
|
|||||||
assert(box != 0);
|
assert(box != 0);
|
||||||
|
|
||||||
if (text != 0 ||
|
if (text != 0 ||
|
||||||
style->display == CSS_DISPLAY_INLINE ||
|
box->type == BOX_INLINE ||
|
||||||
style->float_ == CSS_FLOAT_LEFT ||
|
style->float_ == CSS_FLOAT_LEFT ||
|
||||||
style->float_ == CSS_FLOAT_RIGHT) {
|
style->float_ == CSS_FLOAT_RIGHT) {
|
||||||
/* this is an inline box */
|
/* this is an inline box */
|
||||||
@ -371,8 +373,8 @@ struct box * convert_xml_to_box(xmlNode * n, struct content *content,
|
|||||||
else
|
else
|
||||||
parent->type = BOX_FLOAT_RIGHT;
|
parent->type = BOX_FLOAT_RIGHT;
|
||||||
box_add_child(inline_container, parent);
|
box_add_child(inline_container, parent);
|
||||||
if (style->display == CSS_DISPLAY_INLINE)
|
if (box->type == BOX_INLINE)
|
||||||
style->display = CSS_DISPLAY_BLOCK;
|
box->type = BOX_BLOCK;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -381,7 +383,6 @@ struct box * convert_xml_to_box(xmlNode * n, struct content *content,
|
|||||||
style->display < CSS_DISPLAY_NONE);
|
style->display < CSS_DISPLAY_NONE);
|
||||||
|
|
||||||
/* non-inline box: add to tree and recurse */
|
/* non-inline box: add to tree and recurse */
|
||||||
box->type = box_map[style->display];
|
|
||||||
box_add_child(parent, box);
|
box_add_child(parent, box);
|
||||||
if (convert_children) {
|
if (convert_children) {
|
||||||
inline_container_c = 0;
|
inline_container_c = 0;
|
||||||
@ -399,6 +400,11 @@ struct box * convert_xml_to_box(xmlNode * n, struct content *content,
|
|||||||
box->columns = 1;
|
box->columns = 1;
|
||||||
xmlFree(s);
|
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));
|
LOG(("depth %i, node %p, node type %i END", depth, n, n->type));
|
||||||
return inline_container;
|
return inline_container;
|
||||||
|
@ -92,6 +92,7 @@ struct box {
|
|||||||
char * title;
|
char * title;
|
||||||
unsigned int length;
|
unsigned int length;
|
||||||
unsigned int columns;
|
unsigned int columns;
|
||||||
|
unsigned int rows;
|
||||||
struct box * next;
|
struct box * next;
|
||||||
struct box * prev;
|
struct box * prev;
|
||||||
struct box * children;
|
struct box * children;
|
||||||
|
Loading…
Reference in New Issue
Block a user