summaryrefslogtreecommitdiff
path: root/src/select/properties
diff options
context:
space:
mode:
Diffstat (limited to 'src/select/properties')
-rw-r--r--src/select/properties/helpers.c49
-rw-r--r--src/select/properties/helpers.h3
2 files changed, 52 insertions, 0 deletions
diff --git a/src/select/properties/helpers.c b/src/select/properties/helpers.c
index df076db..1091a10 100644
--- a/src/select/properties/helpers.c
+++ b/src/select/properties/helpers.c
@@ -395,6 +395,55 @@ css_error css__cascade_page_break_after_before_inside(uint32_t opv,
return CSS_OK;
}
+css_error css__cascade_break_after_before_inside(uint32_t opv,
+ css_style *style, css_select_state *state,
+ css_error (*fun)(css_computed_style *, uint8_t))
+{
+ uint16_t value = CSS_BREAK_AFTER_AUTO;
+
+ UNUSED(style);
+
+ if (isInherit(opv) == false) {
+ switch (getValue(opv)) {
+ case BREAK_AFTER_AUTO:
+ value = CSS_BREAK_AFTER_AUTO;
+ break;
+ case BREAK_AFTER_ALWAYS:
+ value = CSS_BREAK_AFTER_ALWAYS;
+ break;
+ case BREAK_AFTER_AVOID:
+ value = CSS_BREAK_AFTER_AVOID;
+ break;
+ case BREAK_AFTER_LEFT:
+ value = CSS_BREAK_AFTER_LEFT;
+ break;
+ case BREAK_AFTER_RIGHT:
+ value = CSS_BREAK_AFTER_RIGHT;
+ break;
+ case BREAK_AFTER_PAGE:
+ value = CSS_BREAK_AFTER_PAGE;
+ break;
+ case BREAK_AFTER_COLUMN:
+ value = CSS_BREAK_AFTER_COLUMN;
+ break;
+ case BREAK_AFTER_AVOID_PAGE:
+ value = CSS_BREAK_AFTER_AVOID_PAGE;
+ break;
+ case BREAK_AFTER_AVOID_COLUMN:
+ value = CSS_BREAK_AFTER_AVOID_COLUMN;
+ break;
+ }
+ }
+
+ /** \todo lose fun != NULL */
+ if (fun != NULL && css__outranks_existing(getOpcode(opv),
+ isImportant(opv), state, isInherit(opv))) {
+ return fun(state->computed, value);
+ }
+
+ return CSS_OK;
+}
+
css_error css__cascade_counter_increment_reset(uint32_t opv, css_style *style,
css_select_state *state,
css_error (*fun)(css_computed_style *, uint8_t,
diff --git a/src/select/properties/helpers.h b/src/select/properties/helpers.h
index 098fe1e..feed146 100644
--- a/src/select/properties/helpers.h
+++ b/src/select/properties/helpers.h
@@ -51,6 +51,9 @@ css_error css__cascade_number(uint32_t opv, css_style *style,
css_error css__cascade_page_break_after_before_inside(uint32_t opv,
css_style *style, css_select_state *state,
css_error (*fun)(css_computed_style *, uint8_t));
+css_error css__cascade_break_after_before_inside(uint32_t opv,
+ css_style *style, css_select_state *state,
+ css_error (*fun)(css_computed_style *, uint8_t));
css_error css__cascade_counter_increment_reset(uint32_t opv, css_style *style,
css_select_state *state,
css_error (*fun)(css_computed_style *, uint8_t,