summaryrefslogtreecommitdiff
path: root/source/html/css-apply.c
diff options
context:
space:
mode:
authorTor Andersson <tor.andersson@artifex.com>2016-04-11 16:58:20 +0200
committerTor Andersson <tor.andersson@artifex.com>2016-04-26 15:12:57 +0200
commit6c6964373ee61805577a7f5374f658dc64098c70 (patch)
tree81999f47b6a372c416396998d78399ebb35a9177 /source/html/css-apply.c
parentb935334975d13548379b58d1883eea98dc0f4eda (diff)
downloadmupdf-6c6964373ee61805577a7f5374f658dc64098c70.tar.xz
epub: Support page-break-before/after: always, left and right.
Does not support page-break-before/after: avoid.
Diffstat (limited to 'source/html/css-apply.c')
-rw-r--r--source/html/css-apply.c17
1 files changed, 17 insertions, 0 deletions
diff --git a/source/html/css-apply.c b/source/html/css-apply.c
index 3daff6b4..bf082f0d 100644
--- a/source/html/css-apply.c
+++ b/source/html/css-apply.c
@@ -1144,6 +1144,21 @@ visibility_from_property(fz_css_match *match)
return V_VISIBLE;
}
+static int
+page_break_from_property(fz_css_match *match, char *prop)
+{
+ fz_css_value *value = value_from_property(match, prop);
+ if (value)
+ {
+ if (!strcmp(value->data, "auto")) return PB_AUTO;
+ else if (!strcmp(value->data, "always")) return PB_ALWAYS;
+ else if (!strcmp(value->data, "avoid")) return PB_AVOID;
+ else if (!strcmp(value->data, "left")) return PB_LEFT;
+ else if (!strcmp(value->data, "right")) return PB_RIGHT;
+ }
+ return PB_AUTO;
+}
+
void
fz_default_css_style(fz_context *ctx, fz_css_style *style)
{
@@ -1170,6 +1185,8 @@ fz_apply_css_style(fz_context *ctx, fz_html_font_set *set, fz_css_style *style,
style->visibility = visibility_from_property(match);
style->white_space = white_space_from_property(match);
+ style->page_break_before = page_break_from_property(match, "page-break-before");
+ style->page_break_after = page_break_from_property(match, "page-break-after");
value = value_from_property(match, "text-align");
if (value)