diff options
author | John Mark Bell <jmb@netsurf-browser.org> | 2009-02-11 00:37:03 +0000 |
---|---|---|
committer | John Mark Bell <jmb@netsurf-browser.org> | 2009-02-11 00:37:03 +0000 |
commit | 03c904ae58e88ca8c4edd6e0a5ef9bdb8cd4dfa4 (patch) | |
tree | c5a55861dc6829ec20084f0ed88c1b5dce94ce04 /src/select | |
parent | f3cabc6af719b10252471883f41ffa9828a7c1f2 (diff) | |
download | libcss-03c904ae58e88ca8c4edd6e0a5ef9bdb8cd4dfa4.tar.gz libcss-03c904ae58e88ca8c4edd6e0a5ef9bdb8cd4dfa4.tar.bz2 |
More property handlers
svn path=/trunk/libcss/; revision=6417
Diffstat (limited to 'src/select')
-rw-r--r-- | src/select/properties.c | 64 |
1 files changed, 47 insertions, 17 deletions
diff --git a/src/select/properties.c b/src/select/properties.c index b4840da..53d1de1 100644 --- a/src/select/properties.c +++ b/src/select/properties.c @@ -237,40 +237,70 @@ static css_error initial_background_repeat(css_computed_style *style) return set_background_repeat(style, CSS_BACKGROUND_REPEAT_REPEAT); } -static css_error cascade_border_collapse( - uint32_t opv, css_style *style, css_select_state *state) +static css_error cascade_border_collapse(uint32_t opv, css_style *style, + css_select_state *state) { - - UNUSED(opv); + uint16_t value = CSS_BORDER_COLLAPSE_INHERIT; + UNUSED(style); - UNUSED(state); + + if (isInherit(opv) == false) { + switch (getValue(opv)) { + case BORDER_COLLAPSE_SEPARATE: + value = CSS_BORDER_COLLAPSE_SEPARATE; + break; + case BORDER_COLLAPSE_COLLAPSE: + value = CSS_BORDER_COLLAPSE_COLLAPSE; + break; + } + } + + if (outranks_existing(getOpcode(opv), isImportant(opv), state)) { + return set_border_collapse(state->result, value); + } return CSS_OK; } static css_error initial_border_collapse(css_computed_style *style) { - UNUSED(style); - - return CSS_OK; + return set_border_collapse(style, CSS_BORDER_COLLAPSE_SEPARATE); } -static css_error cascade_border_spacing( - uint32_t opv, css_style *style, css_select_state *state) +static css_error cascade_border_spacing(uint32_t opv, css_style *style, + css_select_state *state) { - - UNUSED(opv); - UNUSED(style); - UNUSED(state); + uint16_t value = CSS_BORDER_SPACING_INHERIT; + css_fixed hlength = 0; + css_fixed vlength = 0; + uint32_t hunit = CSS_UNIT_PX; + uint32_t vunit = CSS_UNIT_PX; + + if (isInherit(opv) == false) { + value = CSS_BORDER_SPACING_SET; + hlength = *((css_fixed *) style->bytecode); + advance_bytecode(style, sizeof(hlength)); + hunit = *((uint32_t *) style->bytecode); + advance_bytecode(style, sizeof(hunit)); + + vlength = *((css_fixed *) style->bytecode); + advance_bytecode(style, sizeof(vlength)); + vunit = *((uint32_t *) style->bytecode); + advance_bytecode(style, sizeof(vunit)); + } + + if (outranks_existing(getOpcode(opv), isImportant(opv), state)) { + return set_border_spacing(state->result, value, + hlength, hunit, vlength, vunit); + } return CSS_OK; } static css_error initial_border_spacing(css_computed_style *style) { - UNUSED(style); - - return CSS_OK; + return set_border_spacing(style, CSS_BORDER_SPACING_SET, + 0, CSS_UNIT_PX, 0, CSS_UNIT_PX); } static css_error cascade_border_top_color( |