aboutsummaryrefslogtreecommitdiff
path: root/src/styleengine.cc
diff options
context:
space:
mode:
authorcorvid <corvid@lavabit.com>2010-04-20 16:04:24 +0000
committercorvid <corvid@lavabit.com>2010-04-20 16:04:24 +0000
commitbda22922f7ed5934a2c1cd9740836df1a22cbc30 (patch)
tree7e7713dcbca5bfa1bead72abe9bd0388bcadbc4e /src/styleengine.cc
parent7a6266b40e3b340883d1f7fb22c0099a8253cc88 (diff)
css word-spacing property
Diffstat (limited to 'src/styleengine.cc')
-rw-r--r--src/styleengine.cc15
1 files changed, 15 insertions, 0 deletions
diff --git a/src/styleengine.cc b/src/styleengine.cc
index 6691ba41..906f47ee 100644
--- a/src/styleengine.cc
+++ b/src/styleengine.cc
@@ -469,6 +469,21 @@ void StyleEngine::apply (StyleAttrs *attrs, CssPropertyList *props) {
case CSS_PROPERTY_HEIGHT:
computeLength (&attrs->height, p->value.intVal, attrs->font);
break;
+ case CSS_PROPERTY_WORD_SPACING:
+ if (p->type == CSS_TYPE_ENUM) {
+ if (p->value.intVal == CSS_WORD_SPACING_NORMAL) {
+ attrs->wordSpacing = 0;
+ }
+ } else {
+ computeValue(&attrs->wordSpacing, p->value.intVal, attrs->font);
+ }
+
+ /* Limit to reasonable values to avoid overflows */
+ if (attrs->wordSpacing > 1000)
+ attrs->wordSpacing = 1000;
+ else if (attrs->wordSpacing < -1000)
+ attrs->wordSpacing = -1000;
+ break;
case PROPERTY_X_LINK:
attrs->x_link = p->value.intVal;
break;