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