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