diff options
Diffstat (limited to 'src/select/properties/align_items.c')
-rw-r--r-- | src/select/properties/align_items.c | 19 |
1 files changed, 14 insertions, 5 deletions
diff --git a/src/select/properties/align_items.c b/src/select/properties/align_items.c index 007fd70..52ca094 100644 --- a/src/select/properties/align_items.c +++ b/src/select/properties/align_items.c @@ -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); } |