From 5179418ae7f4497ad6fec2e7d1ac2a8ad7492fd8 Mon Sep 17 00:00:00 2001 From: Tor Andersson Date: Thu, 14 May 2015 00:19:44 +0200 Subject: epub: Apply @page selector margins. --- source/html/css-apply.c | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) (limited to 'source/html/css-apply.c') diff --git a/source/html/css-apply.c b/source/html/css-apply.c index d72079e8..6d99c07d 100644 --- a/source/html/css-apply.c +++ b/source/html/css-apply.c @@ -623,6 +623,29 @@ fz_match_css(fz_context *ctx, fz_css_match *match, fz_css_rule *css, fz_xml *nod } } +void +fz_match_css_at_page(fz_context *ctx, fz_css_match *match, fz_css_rule *css) +{ + fz_css_rule *rule; + fz_css_selector *sel; + fz_css_property *prop; + + for (rule = css; rule; rule = rule->next) + { + sel = rule->selector; + while (sel) + { + if (sel->name && !strcmp(sel->name, "@page")) + { + for (prop = rule->declaration; prop; prop = prop->next) + add_property(match, prop->name, prop->value, selector_specificity(sel)); + break; + } + sel = sel->next; + } + } +} + static fz_css_value * value_from_raw_property(fz_css_match *match, const char *name) { -- cgit v1.2.3