diff options
Diffstat (limited to 'src/select/properties/text_decoration.c')
-rw-r--r-- | src/select/properties/text_decoration.c | 19 |
1 files changed, 14 insertions, 5 deletions
diff --git a/src/select/properties/text_decoration.c b/src/select/properties/text_decoration.c index 759009c..bfea8a8 100644 --- a/src/select/properties/text_decoration.c +++ b/src/select/properties/text_decoration.c @@ -59,16 +59,25 @@ css_error css__initial_text_decoration(css_select_state *state) return set_text_decoration(state->computed, CSS_TEXT_DECORATION_NONE); } +css_error css__copy_text_decoration( + const css_computed_style *from, + css_computed_style *to) +{ + if (from == to) { + return CSS_OK; + } + + return set_text_decoration(to, get_text_decoration(from)); +} + css_error css__compose_text_decoration(const css_computed_style *parent, const css_computed_style *child, css_computed_style *result) { uint8_t type = get_text_decoration(child); - if (type == CSS_TEXT_DECORATION_INHERIT) { - type = get_text_decoration(parent); - } - - return set_text_decoration(result, type); + return css__copy_text_decoration( + type == CSS_TEXT_DECORATION_INHERIT ? parent : child, + result); } |