From 0b6d7198f4fc46961c57530e654691b5a66b36f0 Mon Sep 17 00:00:00 2001 From: John Mark Bell Date: Tue, 23 Aug 2011 20:12:41 +0000 Subject: Add support for selecting page-break-{before, after, inside} Credit: James Montgomerie svn path=/trunk/libcss/; revision=12645 --- src/select/properties/page_break_inside.c | 41 +++++++++---------------------- 1 file changed, 12 insertions(+), 29 deletions(-) (limited to 'src/select/properties/page_break_inside.c') diff --git a/src/select/properties/page_break_inside.c b/src/select/properties/page_break_inside.c index 2e27298..20b8bf5 100644 --- a/src/select/properties/page_break_inside.c +++ b/src/select/properties/page_break_inside.c @@ -17,49 +17,32 @@ css_error css__cascade_page_break_inside(uint32_t opv, css_style *style, css_select_state *state) { - UNUSED(style); - - if (isInherit(opv) == false) { - switch (getValue(opv)) { - case PAGE_BREAK_INSIDE_AUTO: - case PAGE_BREAK_INSIDE_AVOID: - /** \todo convert to public values */ - break; - } - } - - if (css__outranks_existing(getOpcode(opv), isImportant(opv), state, - isInherit(opv))) { - /** \todo page-break-inside */ - } - - return CSS_OK; + return css__cascade_page_break_after_before_inside(opv, style, state, + set_page_break_inside); } css_error css__set_page_break_inside_from_hint(const css_hint *hint, css_computed_style *style) { - UNUSED(hint); - UNUSED(style); - - return CSS_OK; + return set_page_break_inside(style, hint->status); } css_error css__initial_page_break_inside(css_select_state *state) { - UNUSED(state); - - return CSS_OK; + return set_page_break_inside(state->computed, + CSS_PAGE_BREAK_INSIDE_AUTO); } css_error css__compose_page_break_inside(const css_computed_style *parent, const css_computed_style *child, css_computed_style *result) { - UNUSED(parent); - UNUSED(child); - UNUSED(result); - - return CSS_OK; + uint8_t type = get_page_break_inside(child); + + if (type == CSS_PAGE_BREAK_INSIDE_INHERIT) { + type = get_page_break_inside(parent); + } + + return set_page_break_inside(result, type); } -- cgit v1.2.3