diff options
Diffstat (limited to 'src/select/properties')
-rw-r--r-- | src/select/properties/column_count.c | 31 |
1 files changed, 19 insertions, 12 deletions
diff --git a/src/select/properties/column_count.c b/src/select/properties/column_count.c index 5fe7465..ecee5f3 100644 --- a/src/select/properties/column_count.c +++ b/src/select/properties/column_count.c @@ -17,23 +17,25 @@ css_error css__cascade_column_count(uint32_t opv, css_style *style, css_select_state *state) { + uint16_t value = CSS_COLUMN_COUNT_INHERIT; css_fixed count = 0; if (isInherit(opv) == false) { switch (getValue(opv)) { case COLUMN_COUNT_SET: + value = CSS_COLUMN_COUNT_SET; count = *((css_fixed *) style->bytecode); advance_bytecode(style, sizeof(count)); break; case COLUMN_COUNT_AUTO: - /** \todo convert to public values */ + value = CSS_COLUMN_COUNT_AUTO; break; } } if (css__outranks_existing(getOpcode(opv), isImportant(opv), state, isInherit(opv))) { - /** \todo set computed elevation */ + return set_column_count(state->computed, value, count); } return CSS_OK; @@ -42,26 +44,31 @@ css_error css__cascade_column_count(uint32_t opv, css_style *style, css_error css__set_column_count_from_hint(const css_hint *hint, css_computed_style *style) { - UNUSED(hint); - UNUSED(style); - - return CSS_OK; + return set_column_count(style, hint->status, hint->data.integer); } css_error css__initial_column_count(css_select_state *state) { - UNUSED(state); - - return CSS_OK; + return set_column_count(state->computed, CSS_COLUMN_COUNT_AUTO, 0); } css_error css__compose_column_count(const css_computed_style *parent, const css_computed_style *child, css_computed_style *result) { - UNUSED(parent); - UNUSED(child); - UNUSED(result); + int32_t count = 0; + uint8_t type = get_column_count(child, &count); + + if ((child->uncommon == NULL && parent->uncommon != NULL) || + type == CSS_COLUMN_COUNT_INHERIT || + (child->uncommon != NULL && result != child)) { + if ((child->uncommon == NULL && parent->uncommon != NULL) || + type == CSS_OUTLINE_COLOR_INHERIT) { + type = get_column_count(parent, &count); + } + + return set_column_count(result, type, count); + } return CSS_OK; } |