summaryrefslogtreecommitdiff
path: root/src/select/properties/clear.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/select/properties/clear.c')
-rw-r--r--src/select/properties/clear.c19
1 files changed, 14 insertions, 5 deletions
diff --git a/src/select/properties/clear.c b/src/select/properties/clear.c
index a753218..1fbc48e 100644
--- a/src/select/properties/clear.c
+++ b/src/select/properties/clear.c
@@ -57,16 +57,25 @@ css_error css__initial_clear(css_select_state *state)
return set_clear(state->computed, CSS_CLEAR_NONE);
}
+css_error css__copy_clear(
+ const css_computed_style *from,
+ css_computed_style *to)
+{
+ if (from == to) {
+ return CSS_OK;
+ }
+
+ return set_clear(to, get_clear(from));
+}
+
css_error css__compose_clear(const css_computed_style *parent,
const css_computed_style *child,
css_computed_style *result)
{
uint8_t type = get_clear(child);
- if (type == CSS_CLEAR_INHERIT) {
- type = get_clear(parent);
- }
-
- return set_clear(result, type);
+ return css__copy_clear(
+ type == CSS_CLEAR_INHERIT ? parent : child,
+ result);
}