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.c23
1 files changed, 16 insertions, 7 deletions
diff --git a/src/select/properties/clear.c b/src/select/properties/clear.c
index bbb2673..1fbc48e 100644
--- a/src/select/properties/clear.c
+++ b/src/select/properties/clear.c
@@ -21,7 +21,7 @@ css_error css__cascade_clear(uint32_t opv, css_style *style,
UNUSED(style);
- if (isInherit(opv) == false) {
+ if (hasFlagValue(opv) == false) {
switch (getValue(opv)) {
case CLEAR_NONE:
value = CSS_CLEAR_NONE;
@@ -39,7 +39,7 @@ css_error css__cascade_clear(uint32_t opv, css_style *style,
}
if (css__outranks_existing(getOpcode(opv), isImportant(opv), state,
- isInherit(opv))) {
+ getFlagValue(opv))) {
return set_clear(state->computed, value);
}
@@ -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);
}