From 3c1be54bb7556f9dcf51befb33d9ac5a548dd6ef Mon Sep 17 00:00:00 2001 From: Johannes Hofmann Date: Sun, 1 May 2011 22:57:59 +0200 Subject: fix handling of CSS length values of 0 without unit Reported by: "Rob S." Submitted by: corvid --- src/styleengine.cc | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'src') 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; } -- cgit v1.2.3