diff options
author | John Mark Bell <jmb@netsurf-browser.org> | 2009-03-05 00:43:58 +0000 |
---|---|---|
committer | John Mark Bell <jmb@netsurf-browser.org> | 2009-03-05 00:43:58 +0000 |
commit | 45820b6d1b931cdcd37e4855447112d0defa7e44 (patch) | |
tree | 2a844eade3d7693e53b22819e3589e1fa7f58cbb /src/select | |
parent | 119b9d1bc1f98048939e4f0e40578510e595b59f (diff) | |
download | libcss-45820b6d1b931cdcd37e4855447112d0defa7e44.tar.gz libcss-45820b6d1b931cdcd37e4855447112d0defa7e44.tar.bz2 |
4 more
svn path=/trunk/libcss/; revision=6699
Diffstat (limited to 'src/select')
-rw-r--r-- | src/select/properties.c | 51 |
1 files changed, 51 insertions, 0 deletions
diff --git a/src/select/properties.c b/src/select/properties.c index 8041b68..9691bcd 100644 --- a/src/select/properties.c +++ b/src/select/properties.c @@ -1981,6 +1981,22 @@ css_error initial_font_size(css_computed_style *style) return set_font_size(style, CSS_FONT_SIZE_MEDIUM, 0, CSS_UNIT_PX); } +css_error compose_font_size(const css_computed_style *parent, + const css_computed_style *child, + css_computed_style *result) +{ + css_fixed size = 0; + css_unit unit = CSS_UNIT_PX; + + if (css_computed_font_size(child, &size, &unit) == + CSS_FONT_SIZE_INHERIT) { + uint8_t p = css_computed_font_size(parent, &size, &unit); + return set_font_size(result, p, size, unit); + } + + return CSS_OK; +} + css_error cascade_font_style(uint32_t opv, css_style *style, css_select_state *state) { @@ -2014,6 +2030,17 @@ css_error initial_font_style(css_computed_style *style) return set_font_style(style, CSS_FONT_STYLE_NORMAL); } +css_error compose_font_style(const css_computed_style *parent, + const css_computed_style *child, + css_computed_style *result) +{ + if (css_computed_font_style(child) == CSS_FONT_STYLE_INHERIT) { + return set_font_style(result, css_computed_font_style(parent)); + } + + return CSS_OK; +} + css_error cascade_font_variant(uint32_t opv, css_style *style, css_select_state *state) { @@ -2044,6 +2071,18 @@ css_error initial_font_variant(css_computed_style *style) return set_font_variant(style, CSS_FONT_VARIANT_NORMAL); } +css_error compose_font_variant(const css_computed_style *parent, + const css_computed_style *child, + css_computed_style *result) +{ + if (css_computed_font_variant(child) == CSS_FONT_VARIANT_INHERIT) { + return set_font_variant(result, + css_computed_font_variant(parent)); + } + + return CSS_OK; +} + css_error cascade_font_weight(uint32_t opv, css_style *style, css_select_state *state) { @@ -2107,6 +2146,18 @@ css_error initial_font_weight(css_computed_style *style) return set_font_weight(style, CSS_FONT_WEIGHT_NORMAL); } +css_error compose_font_weight(const css_computed_style *parent, + const css_computed_style *child, + css_computed_style *result) +{ + if (css_computed_font_weight(child) == CSS_FONT_WEIGHT_INHERIT) { + return set_font_weight(result, + css_computed_font_weight(parent)); + } + + return CSS_OK; +} + css_error cascade_height(uint32_t opv, css_style *style, css_select_state *state) { |