diff options
Diffstat (limited to 'src/select/properties/column_gap.c')
-rw-r--r-- | src/select/properties/column_gap.c | 23 |
1 files changed, 18 insertions, 5 deletions
diff --git a/src/select/properties/column_gap.c b/src/select/properties/column_gap.c index 087eb0f..5776dc9 100644 --- a/src/select/properties/column_gap.c +++ b/src/select/properties/column_gap.c @@ -33,6 +33,21 @@ css_error css__initial_column_gap(css_select_state *state) INTTOFIX(1), CSS_UNIT_EM); } +css_error css__copy_column_gap( + const css_computed_style *from, + css_computed_style *to) +{ + css_fixed length = INTTOFIX(1); + css_unit unit = CSS_UNIT_EM; + uint8_t type = get_column_gap(from, &length, &unit); + + if (from == to) { + return CSS_OK; + } + + return set_column_gap(to, type, length, unit); +} + css_error css__compose_column_gap(const css_computed_style *parent, const css_computed_style *child, css_computed_style *result) @@ -41,9 +56,7 @@ css_error css__compose_column_gap(const css_computed_style *parent, css_unit unit = CSS_UNIT_EM; uint8_t type = get_column_gap(child, &length, &unit); - if (type == CSS_COLUMN_GAP_INHERIT) { - type = get_column_gap(parent, &length, &unit); - } - - return set_column_gap(result, type, length, unit); + return css__copy_column_gap( + type == CSS_COLUMN_GAP_INHERIT ? parent : child, + result); } |