diff options
author | Michael Drake <tlsa@netsurf-browser.org> | 2014-01-10 15:21:06 +0000 |
---|---|---|
committer | Michael Drake <tlsa@netsurf-browser.org> | 2014-01-10 15:21:06 +0000 |
commit | a3737b84a9ab76421cca972139b2ec5a6572ab72 (patch) | |
tree | 7c7f4d8e3715ecc80b1a1f9fb42eef9ff654f74e /src/select/computed.c | |
parent | faf8b75e949c891738fb3a2e404e37c6a76ae252 (diff) | |
download | libcss-a3737b84a9ab76421cca972139b2ec5a6572ab72.tar.gz libcss-a3737b84a9ab76421cca972139b2ec5a6572ab72.tar.bz2 |
Various changes for orphans and widows properties:
+ Keep as int internally, rather than css_fixed.
+ Fix get_widows to return widows instead of orphans.
+ Remove duplicate implementations in css_computed_ getters.
Diffstat (limited to 'src/select/computed.c')
-rw-r--r-- | src/select/computed.c | 50 |
1 files changed, 4 insertions, 46 deletions
diff --git a/src/select/computed.c b/src/select/computed.c index 135fa07..6f0d979 100644 --- a/src/select/computed.c +++ b/src/select/computed.c @@ -1003,59 +1003,17 @@ uint8_t css_computed_page_break_inside(const css_computed_style *style) return get_page_break_inside(style); } -#define CSS_ORPHANS_INDEX 1 -#define CSS_ORPHANS_SHIFT 0 -#define CSS_ORPHANS_MASK 0x1 -uint8_t css_computed_orphans( - const css_computed_style *style, +uint8_t css_computed_orphans(const css_computed_style *style, int32_t *orphans) { - if (style->page != NULL) { - uint8_t bits = style->page->bits[CSS_ORPHANS_INDEX]; - bits &= CSS_ORPHANS_MASK; - bits >>= CSS_ORPHANS_SHIFT; - - *orphans = FIXTOINT(style->page->orphans);; - - /* 1bit: type */ - return bits; - } - - /* Use initial value */ - *orphans = 2; - - return CSS_ORPHANS_SET; + return get_orphans(style, orphans); } -#undef CSS_ORPHANS_MASK -#undef CSS_ORPHANS_SHIFT -#undef CSS_ORPHANS_INDEX -#define CSS_WIDOWS_INDEX 1 -#define CSS_WIDOWS_SHIFT 1 -#define CSS_WIDOWS_MASK 0x2 -uint8_t css_computed_widows( - const css_computed_style *style, +uint8_t css_computed_widows(const css_computed_style *style, int32_t *widows) { - if (style->page != NULL) { - uint8_t bits = style->page->bits[CSS_WIDOWS_INDEX]; - bits &= CSS_WIDOWS_MASK; - bits >>= CSS_WIDOWS_SHIFT; - - *widows = FIXTOINT(style->page->widows); - - /* 1bit: type */ - return bits; - } - - /* Use initial value */ - *widows = 2; - - return CSS_WIDOWS_SET; + return get_widows(style, widows); } -#undef CSS_WIDOWS_MASK -#undef CSS_WIDOWS_SHIFT -#undef CSS_WIDOWS_INDEX /****************************************************************************** |