diff options
Diffstat (limited to 'src/select/properties/min_height.c')
-rw-r--r-- | src/select/properties/min_height.c | 27 |
1 files changed, 20 insertions, 7 deletions
diff --git a/src/select/properties/min_height.c b/src/select/properties/min_height.c index 687d8a1..d05655c 100644 --- a/src/select/properties/min_height.c +++ b/src/select/properties/min_height.c @@ -17,7 +17,7 @@ css_error css__cascade_min_height(uint32_t opv, css_style *style, css_select_state *state) { - return css__cascade_length(opv, style, state, set_min_height); + return css__cascade_length_auto(opv, style, state, set_min_height); } css_error css__set_min_height_from_hint(const css_hint *hint, @@ -29,10 +29,25 @@ css_error css__set_min_height_from_hint(const css_hint *hint, css_error css__initial_min_height(css_select_state *state) { - return set_min_height(state->computed, CSS_MIN_HEIGHT_SET, + return set_min_height(state->computed, CSS_MIN_HEIGHT_AUTO, 0, CSS_UNIT_PX); } +css_error css__copy_min_height( + const css_computed_style *from, + css_computed_style *to) +{ + css_fixed length = 0; + css_unit unit = CSS_UNIT_PX; + uint8_t type = get_min_height(from, &length, &unit); + + if (from == to) { + return CSS_OK; + } + + return set_min_height(to, type, length, unit); +} + css_error css__compose_min_height(const css_computed_style *parent, const css_computed_style *child, css_computed_style *result) @@ -41,10 +56,8 @@ css_error css__compose_min_height(const css_computed_style *parent, css_unit unit = CSS_UNIT_PX; uint8_t type = get_min_height(child, &length, &unit); - if (type == CSS_MIN_HEIGHT_INHERIT) { - type = get_min_height(parent, &length, &unit); - } - - return set_min_height(result, type, length, unit); + return css__copy_min_height( + type == CSS_MIN_HEIGHT_INHERIT ? parent : child, + result); } |