diff options
Diffstat (limited to 'src/select/properties/overflow_x.c')
-rw-r--r-- | src/select/properties/overflow_x.c | 23 |
1 files changed, 16 insertions, 7 deletions
diff --git a/src/select/properties/overflow_x.c b/src/select/properties/overflow_x.c index 817d1d2..98dfba5 100644 --- a/src/select/properties/overflow_x.c +++ b/src/select/properties/overflow_x.c @@ -21,7 +21,7 @@ css_error css__cascade_overflow_x(uint32_t opv, css_style *style, UNUSED(style); - if (isInherit(opv) == false) { + if (hasFlagValue(opv) == false) { switch (getValue(opv)) { case OVERFLOW_VISIBLE: value = CSS_OVERFLOW_VISIBLE; @@ -39,7 +39,7 @@ css_error css__cascade_overflow_x(uint32_t opv, css_style *style, } if (css__outranks_existing(getOpcode(opv), isImportant(opv), state, - isInherit(opv))) { + getFlagValue(opv))) { return set_overflow_x(state->computed, value); } @@ -57,16 +57,25 @@ css_error css__initial_overflow_x(css_select_state *state) return set_overflow_x(state->computed, CSS_OVERFLOW_VISIBLE); } +css_error css__copy_overflow_x( + const css_computed_style *from, + css_computed_style *to) +{ + if (from == to) { + return CSS_OK; + } + + return set_overflow_x(to, get_overflow_x(from)); +} + css_error css__compose_overflow_x(const css_computed_style *parent, const css_computed_style *child, css_computed_style *result) { uint8_t type = get_overflow_x(child); - if (type == CSS_OVERFLOW_INHERIT) { - type = get_overflow_x(parent); - } - - return set_overflow_x(result, type); + return css__copy_overflow_x( + type == CSS_OVERFLOW_INHERIT ? parent : child, + result); } |