diff options
author | Johannes Hofmann <Johannes.Hofmann@gmx.de> | 2011-05-01 22:57:59 +0200 |
---|---|---|
committer | Johannes Hofmann <Johannes.Hofmann@gmx.de> | 2011-05-01 22:57:59 +0200 |
commit | 3c1be54bb7556f9dcf51befb33d9ac5a548dd6ef (patch) | |
tree | b1775876075ecf7ef30ce91097ad3bce2aa6860c | |
parent | 8946d426fee863ec480948006a6733dde5701ee6 (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>
-rw-r--r-- | src/styleengine.cc | 7 |
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; } |