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_before.c | 27 ++++++++++++--------------- 1 file changed, 12 insertions(+), 15 deletions(-) (limited to 'src/select/properties/page_break_before.c') diff --git a/src/select/properties/page_break_before.c b/src/select/properties/page_break_before.c index a0799fd..0acae48 100644 --- a/src/select/properties/page_break_before.c +++ b/src/select/properties/page_break_before.c @@ -17,34 +17,31 @@ css_error css__cascade_page_break_before(uint32_t opv, css_style *style, css_select_state *state) { - /** \todo page-break-before */ - return css__cascade_page_break_after_before(opv, style, state, NULL); + return css__cascade_page_break_after_before_inside(opv, style, state, + set_page_break_before); } css_error css__set_page_break_before_from_hint(const css_hint *hint, css_computed_style *style) { - UNUSED(hint); - UNUSED(style); - - return CSS_OK; + return set_page_break_before(style, hint->status); } css_error css__initial_page_break_before(css_select_state *state) { - UNUSED(state); - - return CSS_OK; + return set_page_break_before(state->computed, + CSS_PAGE_BREAK_BEFORE_AUTO); } css_error css__compose_page_break_before(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_before(child); + + if (type == CSS_PAGE_BREAK_BEFORE_INHERIT) { + type = get_page_break_before(parent); + } + + return set_page_break_before(result, type); } - -- cgit v1.2.3