summaryrefslogtreecommitdiff
path: root/src/select/properties/list_style_type.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/select/properties/list_style_type.c')
-rw-r--r--src/select/properties/list_style_type.c19
1 files changed, 14 insertions, 5 deletions
diff --git a/src/select/properties/list_style_type.c b/src/select/properties/list_style_type.c
index 19cde9b..9d809e6 100644
--- a/src/select/properties/list_style_type.c
+++ b/src/select/properties/list_style_type.c
@@ -201,15 +201,24 @@ css_error css__initial_list_style_type(css_select_state *state)
return set_list_style_type(state->computed, CSS_LIST_STYLE_TYPE_DISC);
}
+css_error css__copy_list_style_type(
+ const css_computed_style *from,
+ css_computed_style *to)
+{
+ if (from == to) {
+ return CSS_OK;
+ }
+
+ return set_list_style_type(to, get_list_style_type(from));
+}
+
css_error css__compose_list_style_type(const css_computed_style *parent,
const css_computed_style *child,
css_computed_style *result)
{
uint8_t type = get_list_style_type(child);
- if (type == CSS_LIST_STYLE_TYPE_INHERIT) {
- type = get_list_style_type(parent);
- }
-
- return set_list_style_type(result, type);
+ return css__copy_list_style_type(
+ type == CSS_LIST_STYLE_TYPE_INHERIT ? parent : child,
+ result);
}