summaryrefslogtreecommitdiff
path: root/src/select/computed.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/select/computed.c')
-rw-r--r--src/select/computed.c50
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
/******************************************************************************