diff options
Diffstat (limited to 'src/select/properties/overflow_y.c')
-rw-r--r-- | src/select/properties/overflow_y.c | 23 |
1 files changed, 16 insertions, 7 deletions
diff --git a/src/select/properties/overflow_y.c b/src/select/properties/overflow_y.c index b54c4c8..d7795a2 100644 --- a/src/select/properties/overflow_y.c +++ b/src/select/properties/overflow_y.c @@ -21,7 +21,7 @@ css_error css__cascade_overflow_y(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_y(uint32_t opv, css_style *style, } if (css__outranks_existing(getOpcode(opv), isImportant(opv), state, - isInherit(opv))) { + getFlagValue(opv))) { return set_overflow_y(state->computed, value); } @@ -57,16 +57,25 @@ css_error css__initial_overflow_y(css_select_state *state) return set_overflow_y(state->computed, CSS_OVERFLOW_VISIBLE); } +css_error css__copy_overflow_y( + const css_computed_style *from, + css_computed_style *to) +{ + if (from == to) { + return CSS_OK; + } + + return set_overflow_y(to, get_overflow_y(from)); +} + css_error css__compose_overflow_y(const css_computed_style *parent, const css_computed_style *child, css_computed_style *result) { uint8_t type = get_overflow_y(child); - if (type == CSS_OVERFLOW_INHERIT) { - type = get_overflow_y(parent); - } - - return set_overflow_y(result, type); + return css__copy_overflow_y( + type == CSS_OVERFLOW_INHERIT ? parent : child, + result); } |