summaryrefslogtreecommitdiff
path: root/src/select/properties/caption_side.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/select/properties/caption_side.c')
-rw-r--r--src/select/properties/caption_side.c23
1 files changed, 16 insertions, 7 deletions
diff --git a/src/select/properties/caption_side.c b/src/select/properties/caption_side.c
index ecccc1d..f0e7693 100644
--- a/src/select/properties/caption_side.c
+++ b/src/select/properties/caption_side.c
@@ -21,7 +21,7 @@ css_error css__cascade_caption_side(uint32_t opv, css_style *style,
UNUSED(style);
- if (isInherit(opv) == false) {
+ if (hasFlagValue(opv) == false) {
switch (getValue(opv)) {
case CAPTION_SIDE_TOP:
value = CSS_CAPTION_SIDE_TOP;
@@ -33,7 +33,7 @@ css_error css__cascade_caption_side(uint32_t opv, css_style *style,
}
if (css__outranks_existing(getOpcode(opv), isImportant(opv), state,
- isInherit(opv))) {
+ getFlagValue(opv))) {
return set_caption_side(state->computed, value);
}
@@ -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);
}