summaryrefslogtreecommitdiff
path: root/src/select
diff options
context:
space:
mode:
authorMichael Drake <tlsa@netsurf-browser.org>2015-01-02 14:50:20 +0000
committerMichael Drake <tlsa@netsurf-browser.org>2015-01-02 14:50:20 +0000
commitca9fa11e374cd2e48d904e8a9f186e1a6eadf8e4 (patch)
tree2ea98cbbc6354ce16649d561710aed1a3b399121 /src/select
parent73da56edc77b70ed4d95db94cbb3d986dd47bf1c (diff)
downloadlibcss-ca9fa11e374cd2e48d904e8a9f186e1a6eadf8e4.tar.gz
libcss-ca9fa11e374cd2e48d904e8a9f186e1a6eadf8e4.tar.bz2
Ensure letter and word spacing are always absolutified.
Diffstat (limited to 'src/select')
-rw-r--r--src/select/computed.c18
1 files changed, 16 insertions, 2 deletions
diff --git a/src/select/computed.c b/src/select/computed.c
index 2dc9055..9028710 100644
--- a/src/select/computed.c
+++ b/src/select/computed.c
@@ -314,7 +314,14 @@ 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)
{
- return get_letter_spacing(style, length, 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;
}
uint8_t css_computed_outline_color(const css_computed_style *style,
@@ -339,7 +346,14 @@ 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)
{
- return get_word_spacing(style, length, 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;
}
uint8_t css_computed_writing_mode(const css_computed_style *style)