diff options
author | Michael Drake <tlsa@netsurf-browser.org> | 2015-01-10 22:02:27 +0000 |
---|---|---|
committer | Michael Drake <tlsa@netsurf-browser.org> | 2015-01-10 22:02:27 +0000 |
commit | 25c4362841e0f3f8eb654c8568ebbaab7696a4ce (patch) | |
tree | be56670491737c955813d7c87b55de98a1612154 /src/select/computed.c | |
parent | f64ba5a6132769248043011c8102584596ae87a9 (diff) | |
download | libcss-25c4362841e0f3f8eb654c8568ebbaab7696a4ce.tar.gz libcss-25c4362841e0f3f8eb654c8568ebbaab7696a4ce.tar.bz2 |
Sync public getter wrapper's absolutification handling.
Diffstat (limited to 'src/select/computed.c')
-rw-r--r-- | src/select/computed.c | 27 |
1 files changed, 10 insertions, 17 deletions
diff --git a/src/select/computed.c b/src/select/computed.c index e653bf3..d78f3b0 100644 --- a/src/select/computed.c +++ b/src/select/computed.c @@ -308,14 +308,7 @@ css_error css_computed_style_compose(const css_computed_style *parent, uint8_t css_computed_letter_spacing(const css_computed_style *style, css_fixed *length, css_unit *unit) { - /* This property is in the uncommon block, so we need to do - * absolute value calculation here. */ - if (get_letter_spacing(style, length, unit) != CSS_LETTER_SPACING_SET) { - *length = INTTOFIX(0); - *unit = CSS_UNIT_PX; - } - - return CSS_LETTER_SPACING_SET; + return get_letter_spacing(style, length, unit); } uint8_t css_computed_outline_color(const css_computed_style *style, @@ -327,7 +320,14 @@ uint8_t css_computed_outline_color(const css_computed_style *style, uint8_t css_computed_outline_width(const css_computed_style *style, css_fixed *length, css_unit *unit) { - return get_outline_width(style, length, unit); + /* This property is in the uncommon block, so we need to handle + * absolute value calculation for initial value (medium) here. */ + if (get_outline_width(style, length, unit) == CSS_BORDER_WIDTH_MEDIUM) { + *length = INTTOFIX(2); + *unit = CSS_UNIT_PX; + } + + return CSS_BORDER_WIDTH_WIDTH; } uint8_t css_computed_border_spacing(const css_computed_style *style, @@ -340,14 +340,7 @@ uint8_t css_computed_border_spacing(const css_computed_style *style, uint8_t css_computed_word_spacing(const css_computed_style *style, css_fixed *length, css_unit *unit) { - /* This property is in the uncommon block, so we need to do - * absolute value calculation here. */ - if (get_word_spacing(style, length, unit) != CSS_WORD_SPACING_SET) { - *length = INTTOFIX(0); - *unit = CSS_UNIT_PX; - } - - return CSS_WORD_SPACING_SET; + return get_word_spacing(style, length, unit); } uint8_t css_computed_writing_mode(const css_computed_style *style) |