diff options
author | Tor Andersson <tor.andersson@artifex.com> | 2014-10-23 14:45:50 +0200 |
---|---|---|
committer | Tor Andersson <tor.andersson@artifex.com> | 2014-12-03 12:25:51 +0100 |
commit | b231d01f2ff24f294f9e30cf2ad82a62145ad437 (patch) | |
tree | da7985c66ed63680884ae1b67bd27dcb356570f0 /source/html/css-apply.c | |
parent | d79203b42621257aed8e4c02e4e6c95ec82d9243 (diff) | |
download | mupdf-b231d01f2ff24f294f9e30cf2ad82a62145ad437.tar.xz |
html: Start laying out boxes.
Diffstat (limited to 'source/html/css-apply.c')
-rw-r--r-- | source/html/css-apply.c | 21 |
1 files changed, 10 insertions, 11 deletions
diff --git a/source/html/css-apply.c b/source/html/css-apply.c index 1a93e3e4..9a73ee2a 100644 --- a/source/html/css-apply.c +++ b/source/html/css-apply.c @@ -761,11 +761,10 @@ compute_number(struct value *value, float em, float hundred, float scale, float } void -compute_style(struct computed_style *style, struct style *node) +compute_style(struct computed_style *style, struct style *node, float width) { struct value *value; float em = 12; - float hundred = 100; memset(style, 0, sizeof *style); @@ -829,25 +828,25 @@ compute_style(struct computed_style *style, struct style *node) style->line_height = compute_number(value, em, em, em, 1.2 * em); value = get_style_property(node, "text-indent"); - style->text_indent = compute_number(value, em, hundred, 1, 0); + style->text_indent = compute_number(value, em, width, 1, 0); value = get_style_property(node, "margin-top"); - style->margin[0] = compute_number(value, em, hundred, 1, 0); + style->margin[0] = compute_number(value, em, width, 1, 0); value = get_style_property(node, "margin-right"); - style->margin[1] = compute_number(value, em, hundred, 1, 0); + style->margin[1] = compute_number(value, em, width, 1, 0); value = get_style_property(node, "margin-bottom"); - style->margin[2] = compute_number(value, em, hundred, 1, 0); + style->margin[2] = compute_number(value, em, width, 1, 0); value = get_style_property(node, "margin-left"); - style->margin[3] = compute_number(value, em, hundred, 1, 0); + style->margin[3] = compute_number(value, em, width, 1, 0); value = get_style_property(node, "padding-top"); - style->padding[0] = compute_number(value, em, hundred, 1, 0); + style->padding[0] = compute_number(value, em, width, 1, 0); value = get_style_property(node, "padding-right"); - style->padding[1] = compute_number(value, em, hundred, 1, 0); + style->padding[1] = compute_number(value, em, width, 1, 0); value = get_style_property(node, "padding-bottom"); - style->padding[2] = compute_number(value, em, hundred, 1, 0); + style->padding[2] = compute_number(value, em, width, 1, 0); value = get_style_property(node, "padding-left"); - style->padding[3] = compute_number(value, em, hundred, 1, 0); + style->padding[3] = compute_number(value, em, width, 1, 0); { const char *font_family = get_style_property_string(node, "font-family", "serif"); |