diff options
author | Tor Andersson <tor.andersson@artifex.com> | 2015-05-14 00:19:44 +0200 |
---|---|---|
committer | Tor Andersson <tor.andersson@artifex.com> | 2015-05-15 16:12:23 +0200 |
commit | 5179418ae7f4497ad6fec2e7d1ac2a8ad7492fd8 (patch) | |
tree | a974080219ab4ecf51594d88a29d8d0b45ce46a4 /source/html/css-apply.c | |
parent | eaaca0513d26fa9e7cc515dbba950536c0005c06 (diff) | |
download | mupdf-5179418ae7f4497ad6fec2e7d1ac2a8ad7492fd8.tar.xz |
epub: Apply @page selector margins.
Diffstat (limited to 'source/html/css-apply.c')
-rw-r--r-- | source/html/css-apply.c | 23 |
1 files changed, 23 insertions, 0 deletions
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) { |