summaryrefslogtreecommitdiff
path: root/render/layout.c
diff options
context:
space:
mode:
authorMichael Drake <tlsa@netsurf-browser.org>2009-01-29 22:57:32 +0000
committerMichael Drake <tlsa@netsurf-browser.org>2009-01-29 22:57:32 +0000
commitdaf8c22d1b005acde3831cbcba37835efa426fb8 (patch)
tree49fbd26aa4bb04f1a8b6c91c4b4e8f2b5d421dec /render/layout.c
parent56b48410bee02be1c774df14c1f1ca93cea56a21 (diff)
downloadnetsurf-daf8c22d1b005acde3831cbcba37835efa426fb8.tar.gz
netsurf-daf8c22d1b005acde3831cbcba37835efa426fb8.tar.bz2
Only get top margin if box has style.
svn path=/trunk/netsurf/; revision=6295
Diffstat (limited to 'render/layout.c')
-rw-r--r--render/layout.c18
1 files changed, 4 insertions, 14 deletions
diff --git a/render/layout.c b/render/layout.c
index 709f516be..ba18502a5 100644
--- a/render/layout.c
+++ b/render/layout.c
@@ -327,20 +327,10 @@ bool layout_block_context(struct box *block, struct content *content)
box->style->clear);
/* Get top margin */
- switch (box->style->margin[TOP].margin) {
- case CSS_MARGIN_LENGTH:
- box->margin[TOP] = css_len2px(&box->style->margin[TOP].
- value.length, box->style);
- break;
- case CSS_MARGIN_PERCENT:
- box->margin[TOP] = box->parent->width *
- box->style->margin[TOP].value.percent /
- 100;
- break;
- case CSS_MARGIN_AUTO:
- default:
- box->margin[TOP] = 0;
- break;
+ if (box->style) {
+ layout_find_dimensions(box->parent->width, box,
+ box->style, NULL, NULL, NULL, NULL,
+ box->margin, NULL, NULL);
}
if (max_pos_margin < box->margin[TOP])