diff options
Diffstat (limited to 'src/select/properties/caption_side.c')
-rw-r--r-- | src/select/properties/caption_side.c | 19 |
1 files changed, 14 insertions, 5 deletions
diff --git a/src/select/properties/caption_side.c b/src/select/properties/caption_side.c index e1b7930..f0e7693 100644 --- a/src/select/properties/caption_side.c +++ b/src/select/properties/caption_side.c @@ -51,16 +51,25 @@ css_error css__initial_caption_side(css_select_state *state) return set_caption_side(state->computed, CSS_CAPTION_SIDE_TOP); } +css_error css__copy_caption_side( + const css_computed_style *from, + css_computed_style *to) +{ + if (from == to) { + return CSS_OK; + } + + return set_caption_side(to, get_caption_side(from)); +} + css_error css__compose_caption_side(const css_computed_style *parent, const css_computed_style *child, css_computed_style *result) { uint8_t type = get_caption_side(child); - if (type == CSS_CAPTION_SIDE_INHERIT) { - type = get_caption_side(parent); - } - - return set_caption_side(result, type); + return css__copy_caption_side( + type == CSS_CAPTION_SIDE_INHERIT ? parent : child, + result); } |