diff options
author | Tor Andersson <tor.andersson@artifex.com> | 2015-10-06 12:33:59 +0200 |
---|---|---|
committer | Tor Andersson <tor.andersson@artifex.com> | 2015-10-06 12:33:59 +0200 |
commit | d97c9eda43563ca95b11e1da7ad43fd2a320d8e0 (patch) | |
tree | 8109cf501e07a53c4218a236c886238e7a53da1e /source/html/css-apply.c | |
parent | ec80f5d9a3e5a44e0a7bec439d895bfb97f78fff (diff) | |
download | mupdf-d97c9eda43563ca95b11e1da7ad43fd2a320d8e0.tar.xz |
epub: Implement style 'visibility' attribute.
Diffstat (limited to 'source/html/css-apply.c')
-rw-r--r-- | source/html/css-apply.c | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/source/html/css-apply.c b/source/html/css-apply.c index 551dc2d8..acb19244 100644 --- a/source/html/css-apply.c +++ b/source/html/css-apply.c @@ -944,10 +944,24 @@ white_space_from_property(fz_css_match *match) return WS_NORMAL; } +static int +visibility_from_property(fz_css_match *match) +{ + fz_css_value *value = value_from_property(match, "visibility"); + if (value) + { + if (!strcmp(value->data, "visible")) return V_VISIBLE; + else if (!strcmp(value->data, "hidden")) return V_HIDDEN; + else if (!strcmp(value->data, "collapse")) return V_COLLAPSE; + } + return V_VISIBLE; +} + void fz_default_css_style(fz_context *ctx, fz_css_style *style) { memset(style, 0, sizeof *style); + style->visibility = V_VISIBLE; style->text_align = TA_LEFT; style->vertical_align = VA_BASELINE; style->white_space = WS_NORMAL; @@ -967,6 +981,7 @@ fz_apply_css_style(fz_context *ctx, fz_html_font_set *set, fz_css_style *style, fz_default_css_style(ctx, style); + style->visibility = visibility_from_property(match); style->white_space = white_space_from_property(match); value = value_from_property(match, "text-align"); |