summaryrefslogtreecommitdiff
path: root/render/box_construct.c
diff options
context:
space:
mode:
authorMichael Drake <tlsa@netsurf-browser.org>2008-10-12 21:22:28 +0000
committerMichael Drake <tlsa@netsurf-browser.org>2008-10-12 21:22:28 +0000
commitb7a1b3999e2b9790bbd070b8e0cdef3abdc6f096 (patch)
treedf39e841ab8524c2ccc8e4d69ca4088e0e4e05b4 /render/box_construct.c
parentc1db0e90cca4a4b7fd7fc9ccbaf679554875bee1 (diff)
downloadnetsurf-b7a1b3999e2b9790bbd070b8e0cdef3abdc6f096.tar.gz
netsurf-b7a1b3999e2b9790bbd070b8e0cdef3abdc6f096.tar.bz2
Implement percentage heights for block level elements in normal flow, floats and positioned boxes. Percentage min/max-height not yet handled.
svn path=/trunk/netsurf/; revision=5550
Diffstat (limited to 'render/box_construct.c')
-rw-r--r--render/box_construct.c26
1 files changed, 16 insertions, 10 deletions
diff --git a/render/box_construct.c b/render/box_construct.c
index fb605209b..94ca2ef57 100644
--- a/render/box_construct.c
+++ b/render/box_construct.c
@@ -583,9 +583,14 @@ bool box_construct_element(xmlNode *n, struct content *content,
float current;
for (child = box->children; child;
child = child->next) {
- current = css_len2px(
+ if (child->style->height.height ==
+ CSS_HEIGHT_LENGTH)
+ current = css_len2px(
&child->style->height.
- length, child->style);
+ value.length,
+ child->style);
+ else
+ current = 0;
if (child->type == BOX_TABLE_CELL &&
value > current) {
/* Row height exceeds cell
@@ -593,10 +598,11 @@ bool box_construct_element(xmlNode *n, struct content *content,
* to row height */
child->style->height.height =
CSS_HEIGHT_LENGTH;
- child->style->height.length.
- unit = CSS_UNIT_PX;
- child->style->height.length.
- value = value;
+ child->style->height.value.
+ length.unit =
+ CSS_UNIT_PX;
+ child->style->height.value.
+ length.value = value;
}
}
}
@@ -932,8 +938,8 @@ struct css_style * box_get_style(struct content *c,
* percentage heights mean, so ignore them */
} else {
style->height.height = CSS_HEIGHT_LENGTH;
- style->height.length.unit = CSS_UNIT_PX;
- style->height.length.value = value;
+ style->height.value.length.unit = CSS_UNIT_PX;
+ style->height.value.length.value = value;
}
xmlFree(s);
}
@@ -1027,8 +1033,8 @@ struct css_style * box_get_style(struct content *c,
int value = isdigit(s[0]) ? atoi(s): -1;
if (0 < value) {
style->height.height = CSS_HEIGHT_LENGTH;
- style->height.length.unit = CSS_UNIT_EM;
- style->height.length.value = value;
+ style->height.value.length.unit = CSS_UNIT_EM;
+ style->height.value.length.value = value;
}
xmlFree(s);
}