diff options
Diffstat (limited to 'src/select/properties/align_items.c')
-rw-r--r-- | src/select/properties/align_items.c | 23 |
1 files changed, 16 insertions, 7 deletions
diff --git a/src/select/properties/align_items.c b/src/select/properties/align_items.c index ad69c81..52ca094 100644 --- a/src/select/properties/align_items.c +++ b/src/select/properties/align_items.c @@ -21,7 +21,7 @@ css_error css__cascade_align_items(uint32_t opv, css_style *style, UNUSED(style); - if (isInherit(opv) == false) { + if (hasFlagValue(opv) == false) { switch (getValue(opv)) { case ALIGN_ITEMS_STRETCH: value = CSS_ALIGN_ITEMS_STRETCH; @@ -42,7 +42,7 @@ css_error css__cascade_align_items(uint32_t opv, css_style *style, } if (css__outranks_existing(getOpcode(opv), isImportant(opv), state, - isInherit(opv))) { + getFlagValue(opv))) { return set_align_items(state->computed, value); } @@ -60,16 +60,25 @@ css_error css__initial_align_items(css_select_state *state) return set_align_items(state->computed, CSS_ALIGN_ITEMS_STRETCH); } +css_error css__copy_align_items( + const css_computed_style *from, + css_computed_style *to) +{ + if (from == to) { + return CSS_OK; + } + + return set_align_items(to, get_align_items(from)); +} + css_error css__compose_align_items(const css_computed_style *parent, const css_computed_style *child, css_computed_style *result) { uint8_t type = get_align_items(child); - if (type == CSS_ALIGN_ITEMS_INHERIT) { - type = get_align_items(parent); - } - - return set_align_items(result, type); + return css__copy_align_items( + type == CSS_ALIGN_ITEMS_INHERIT ? parent : child, + result); } |