summaryrefslogtreecommitdiff
path: root/src/select/properties/flex_wrap.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/select/properties/flex_wrap.c')
-rw-r--r--src/select/properties/flex_wrap.c21
1 files changed, 16 insertions, 5 deletions
diff --git a/src/select/properties/flex_wrap.c b/src/select/properties/flex_wrap.c
index 55034d7..3ca9b74 100644
--- a/src/select/properties/flex_wrap.c
+++ b/src/select/properties/flex_wrap.c
@@ -54,16 +54,27 @@ css_error css__initial_flex_wrap(css_select_state *state)
return set_flex_wrap(state->computed, CSS_FLEX_WRAP_NOWRAP);
}
+css_error css__copy_flex_wrap(
+ const css_computed_style *from,
+ css_computed_style *to)
+{
+ uint8_t type = get_flex_wrap(from);
+
+ if (from == to) {
+ return CSS_OK;
+ }
+
+ return set_flex_wrap(to, type);
+}
+
css_error css__compose_flex_wrap(const css_computed_style *parent,
const css_computed_style *child,
css_computed_style *result)
{
uint8_t type = get_flex_wrap(child);
- if (type == CSS_FLEX_WRAP_INHERIT) {
- type = get_flex_wrap(parent);
- }
-
- return set_flex_wrap(result, type);
+ return css__copy_flex_wrap(
+ type == CSS_FLEX_WRAP_INHERIT ? parent : child,
+ result);
}