summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJohannes Hofmann <Johannes.Hofmann@gmx.de>2011-05-01 22:57:59 +0200
committerJohannes Hofmann <Johannes.Hofmann@gmx.de>2011-05-01 22:57:59 +0200
commit3c1be54bb7556f9dcf51befb33d9ac5a548dd6ef (patch)
treeb1775876075ecf7ef30ce91097ad3bce2aa6860c /src
parent8946d426fee863ec480948006a6733dde5701ee6 (diff)
fix handling of CSS length values of 0 without unit
Reported by: "Rob S." <mr_semantics@hotmail.com> Submitted by: corvid <corvid@lavabit.com>
Diffstat (limited to 'src')
-rw-r--r--src/styleengine.cc7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/styleengine.cc b/src/styleengine.cc
index 9e859aa0..aa09f286 100644
--- a/src/styleengine.cc
+++ b/src/styleengine.cc
@@ -619,6 +619,13 @@ bool StyleEngine::computeValue (int *dest, CssLength value, Font *font) {
case CSS_LENGTH_TYPE_EX:
*dest = roundInt (CSS_LENGTH_VALUE(value) * font->xHeight);
return true;
+ case CSS_LENGTH_TYPE_NONE:
+ // length values other than 0 without unit are only allowed
+ // in special cases (line-height) and have to be handled
+ // separately.
+ assert ((int) CSS_LENGTH_VALUE (value) == 0);
+ *dest = 0;
+ return true;
default:
break;
}