diff options
Diffstat (limited to 'src/select/properties/white_space.c')
-rw-r--r-- | src/select/properties/white_space.c | 23 |
1 files changed, 16 insertions, 7 deletions
diff --git a/src/select/properties/white_space.c b/src/select/properties/white_space.c index b8d2e02..edc35cd 100644 --- a/src/select/properties/white_space.c +++ b/src/select/properties/white_space.c @@ -21,7 +21,7 @@ css_error css__cascade_white_space(uint32_t opv, css_style *style, UNUSED(style); - if (isInherit(opv) == false) { + if (hasFlagValue(opv) == false) { switch (getValue(opv)) { case WHITE_SPACE_NORMAL: value = CSS_WHITE_SPACE_NORMAL; @@ -42,7 +42,7 @@ css_error css__cascade_white_space(uint32_t opv, css_style *style, } if (css__outranks_existing(getOpcode(opv), isImportant(opv), state, - isInherit(opv))) { + getFlagValue(opv))) { return set_white_space(state->computed, value); } @@ -60,16 +60,25 @@ css_error css__initial_white_space(css_select_state *state) return set_white_space(state->computed, CSS_WHITE_SPACE_NORMAL); } +css_error css__copy_white_space( + const css_computed_style *from, + css_computed_style *to) +{ + if (from == to) { + return CSS_OK; + } + + return set_white_space(to, get_white_space(from)); +} + css_error css__compose_white_space(const css_computed_style *parent, const css_computed_style *child, css_computed_style *result) { uint8_t type = get_white_space(child); - if (type == CSS_WHITE_SPACE_INHERIT) { - type = get_white_space(parent); - } - - return set_white_space(result, type); + return css__copy_white_space( + type == CSS_WHITE_SPACE_INHERIT ? parent : child, + result); } |