diff options
Diffstat (limited to 'src/select/properties/align_self.c')
-rw-r--r-- | src/select/properties/align_self.c | 23 |
1 files changed, 16 insertions, 7 deletions
diff --git a/src/select/properties/align_self.c b/src/select/properties/align_self.c index e8e469e..abdb3fe 100644 --- a/src/select/properties/align_self.c +++ b/src/select/properties/align_self.c @@ -21,7 +21,7 @@ css_error css__cascade_align_self(uint32_t opv, css_style *style, UNUSED(style); - if (isInherit(opv) == false) { + if (hasFlagValue(opv) == false) { switch (getValue(opv)) { case ALIGN_SELF_STRETCH: value = CSS_ALIGN_SELF_STRETCH; @@ -45,7 +45,7 @@ css_error css__cascade_align_self(uint32_t opv, css_style *style, } if (css__outranks_existing(getOpcode(opv), isImportant(opv), state, - isInherit(opv))) { + getFlagValue(opv))) { return set_align_self(state->computed, value); } @@ -63,16 +63,25 @@ css_error css__initial_align_self(css_select_state *state) return set_align_self(state->computed, CSS_ALIGN_SELF_AUTO); } +css_error css__copy_align_self( + const css_computed_style *from, + css_computed_style *to) +{ + if (from == to) { + return CSS_OK; + } + + return set_align_self(to, get_align_self(from)); +} + css_error css__compose_align_self(const css_computed_style *parent, const css_computed_style *child, css_computed_style *result) { uint8_t type = get_align_self(child); - if (type == CSS_ALIGN_SELF_INHERIT) { - type = get_align_self(parent); - } - - return set_align_self(result, type); + return css__copy_align_self( + type == CSS_ALIGN_SELF_INHERIT ? parent : child, + result); } |