diff options
Diffstat (limited to 'src/select/properties/font_weight.c')
-rw-r--r-- | src/select/properties/font_weight.c | 19 |
1 files changed, 14 insertions, 5 deletions
diff --git a/src/select/properties/font_weight.c b/src/select/properties/font_weight.c index d9dffc9..da918a1 100644 --- a/src/select/properties/font_weight.c +++ b/src/select/properties/font_weight.c @@ -84,16 +84,25 @@ css_error css__initial_font_weight(css_select_state *state) return set_font_weight(state->computed, CSS_FONT_WEIGHT_NORMAL); } +css_error css__copy_font_weight( + const css_computed_style *from, + css_computed_style *to) +{ + if (from == to) { + return CSS_OK; + } + + return set_font_weight(to, get_font_weight(from)); +} + css_error css__compose_font_weight(const css_computed_style *parent, const css_computed_style *child, css_computed_style *result) { uint8_t type = get_font_weight(child); - if (type == CSS_FONT_WEIGHT_INHERIT) { - type = get_font_weight(parent); - } - - return set_font_weight(result, type); + return css__copy_font_weight( + type == CSS_FONT_WEIGHT_INHERIT ? parent : child, + result); } |