summaryrefslogtreecommitdiff
path: root/source/html/css-apply.c
diff options
context:
space:
mode:
authorTor Andersson <tor.andersson@artifex.com>2014-11-18 16:09:40 +0100
committerTor Andersson <tor.andersson@artifex.com>2014-12-03 12:25:52 +0100
commitf18636e80edab0dadd07917ea26ec4c18102b99a (patch)
tree36bc9ef859f6d1de33b18da7e9a2f35be0fa62e6 /source/html/css-apply.c
parentd88d131bae7d516b1b8ad9c94706d0813bbb1497 (diff)
downloadmupdf-f18636e80edab0dadd07917ea26ec4c18102b99a.tar.xz
html: Cleanups.
Diffstat (limited to 'source/html/css-apply.c')
-rw-r--r--source/html/css-apply.c27
1 files changed, 21 insertions, 6 deletions
diff --git a/source/html/css-apply.c b/source/html/css-apply.c
index eecb8111..67814440 100644
--- a/source/html/css-apply.c
+++ b/source/html/css-apply.c
@@ -984,7 +984,7 @@ default_computed_style(struct computed_style *style)
{
memset(style, 0, sizeof *style);
style->text_align = TA_LEFT;
- style->vertical_align = 0;
+ style->vertical_align = VA_BASELINE;
style->white_space = WS_NORMAL;
style->font_size = make_number(1, N_SCALE);
}
@@ -1017,10 +1017,16 @@ compute_style(html_document *doc, struct computed_style *style, struct style *no
value = get_style_property(node, "vertical-align");
if (value)
{
- if (!strcmp(value->data, "super"))
- style->vertical_align = 1;
+ if (!strcmp(value->data, "baseline"))
+ style->vertical_align = VA_BASELINE;
if (!strcmp(value->data, "sub"))
- style->vertical_align = -1;
+ style->vertical_align = VA_SUB;
+ if (!strcmp(value->data, "super"))
+ style->vertical_align = VA_SUPER;
+ if (!strcmp(value->data, "top"))
+ style->vertical_align = VA_TOP;
+ if (!strcmp(value->data, "bottom"))
+ style->vertical_align = VA_BOTTOM;
}
value = get_style_property(node, "font-size");
@@ -1042,6 +1048,17 @@ compute_style(html_document *doc, struct computed_style *style, struct style *no
style->font_size = make_number(1, N_SCALE);
}
+ value = get_style_property(node, "border-style");
+ if (value)
+ {
+ if (!strcmp(value->data, "none"))
+ style->border_style = BS_NONE;
+ if (!strcmp(value->data, "hidden"))
+ style->border_style = BS_NONE;
+ if (!strcmp(value->data, "solid"))
+ style->border_style = BS_SOLID;
+ }
+
style->line_height = number_from_property(node, "line-height", 1.2, N_SCALE);
style->text_indent = number_from_property(node, "text-indent", 0, N_NUMBER);
@@ -1065,8 +1082,6 @@ compute_style(html_document *doc, struct computed_style *style, struct style *no
style->background_color = color_from_property(node, "background-color", transparent);
style->border_color = color_from_property(node, "border-color", style->color);
- style->border_style = !strcmp(get_style_property_string(node, "border-style", "none"), "solid");
-
{
const char *font_family = get_style_property_string(node, "font-family", "serif");
const char *font_variant = get_style_property_string(node, "font-variant", "normal");