diff options
Diffstat (limited to 'src/select/properties')
-rw-r--r-- | src/select/properties/orphans.c | 25 | ||||
-rw-r--r-- | src/select/properties/windows.c | 25 |
2 files changed, 22 insertions, 28 deletions
diff --git a/src/select/properties/orphans.c b/src/select/properties/orphans.c index 5129c5d..265c6f5 100644 --- a/src/select/properties/orphans.c +++ b/src/select/properties/orphans.c @@ -17,34 +17,31 @@ css_error css__cascade_orphans(uint32_t opv, css_style *style, css_select_state *state) { - /** \todo orphans */ - return css__cascade_number(opv, style, state, NULL); + return css__cascade_number(opv, style, state, set_orphans); } css_error css__set_orphans_from_hint(const css_hint *hint, css_computed_style *style) { - UNUSED(hint); - UNUSED(style); - - return CSS_OK; + return set_orphans(style, hint->status, hint->data.fixed); } css_error css__initial_orphans(css_select_state *state) { - UNUSED(state); - - return CSS_OK; + return set_orphans(state->computed, CSS_ORPHANS_SET, INTTOFIX(2)); } css_error css__compose_orphans(const css_computed_style *parent, const css_computed_style *child, css_computed_style *result) { - UNUSED(parent); - UNUSED(child); - UNUSED(result); - - return CSS_OK; + css_fixed count = 0; + uint8_t type = get_orphans(child, &count); + + if (type == CSS_ORPHANS_INHERIT) { + type = get_orphans(parent, &count); + } + + return set_orphans(result, type, count); } diff --git a/src/select/properties/windows.c b/src/select/properties/windows.c index 80b1eee..3f568cb 100644 --- a/src/select/properties/windows.c +++ b/src/select/properties/windows.c @@ -17,34 +17,31 @@ css_error css__cascade_widows(uint32_t opv, css_style *style, css_select_state *state) { - /** \todo widows */ - return css__cascade_number(opv, style, state, NULL); + return css__cascade_number(opv, style, state, set_widows); } css_error css__set_widows_from_hint(const css_hint *hint, css_computed_style *style) { - UNUSED(hint); - UNUSED(style); - - return CSS_OK; + return set_widows(style, hint->status, hint->data.fixed); } css_error css__initial_widows(css_select_state *state) { - UNUSED(state); - - return CSS_OK; + return set_widows(state->computed, CSS_WIDOWS_SET, INTTOFIX(2)); } css_error css__compose_widows(const css_computed_style *parent, const css_computed_style *child, css_computed_style *result) { - UNUSED(parent); - UNUSED(child); - UNUSED(result); - - return CSS_OK; + css_fixed count = 0; + uint8_t type = get_widows(child, &count); + + if (type == CSS_WIDOWS_INHERIT) { + type = get_widows(parent, &count); + } + + return set_widows(result, type, count); } |